Formatting example
See original GitHub issueIt took me long time to figure out some simple formatting. The examples I found with a formatter function, simply did not work for me. Finally I got this working:
logger.add(new winston.transports.File({
level: 'info', // Log this level and all higher priorities
filename: 'myfile.log',
format: winston.format.combine(
winston.format(options => {
return {
'level': options.level,
'message': options.message,
'my_own_nr': 12345,
'nice_text': 'hello there'
}
})(),
winston.format.timestamp(),
winston.format.json()
)
}))
Maybe good to add to documentation?
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
6 Content Formatting Examples to Energize Your Blog Format
A comprehensive look at how to create a blog format that gets read and remembered. Review these six content formatting examples for better...
Read more >Formatting Style Types & Examples - Video & Lesson Transcript
An example of formatting would include whether the paper is double spaced or single spaced, where the page numbers are located, and whether ......
Read more >4 Best Documentation Formatting Examples
In this article, we'll go over technical documentation formatting best practices and some documentation formatting examples and tips you can use.
Read more >MLA General Format - Purdue OWL
Here is a sample of the first page of a paper in MLA style: This image shows the first page of an MLA...
Read more >Text Formatting Examples - Wiki
Italicized text here. | ''Italicized text here.'' Strong emphasized | '''Strong emphasized'''. Strong italic text:-) | '''Strong ''italic ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
+1 Don’t know how to configure
There is a comment on #1430 which resolves the issue with
info
“losing data” between transports.