transports.File stops logger without any error message
See original GitHub issueI’m trying to use transports.File to save log file in loop with logger. After several logs print out it stops to write log to file and print nothing in console without any error message.
Here is my test code:
import winston from 'winston'
const winstonConfig = {
level: 'debug',
transports: [
new winston.transports.Console(),
new winston.transports.File({
filename: 'file/path/to/combined.log',
maxsize: 10 * 1024 * 1024,
maxFiles: 10
})
]
}
let logger = winston.createLogger(winstonConfig)
for(let i=0; i<10000; i++){
logger.debug(i)
}
Is it stdout buffer issue?
I’m using version 3.0.0-rc1 with node:8-alpine image in docker container
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:30 (2 by maintainers)
Top Results From Across the Web
Winston not logging at any log level, what could be wrong?
On the new production server, Winston logs the very first log message per .js file, period. It stops logging after that, and changing...
Read more >A Complete Guide to Winston Logging in Node.js - Better Stack
log file, but a separate app-error.log will also be created and it will contain only error messages. Note that the level property on...
Read more >Winston - Best of JS
For example, one may want error logs to be stored in a persistent remote ... transports, [] (No transports), Set of logging targets...
Read more >Node.js Logging with Winston - Reflectoring
log file, while only the error messages would be saved in an error.log file and the console transport will log messages to the...
Read more >Complete Winston Logger Guide With Hands-on Examples
By default, the log message is not formatted and is printed as a ... 30 transports options, which include logging out into a...
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
@rcoedo commit fixes the issue but there is still an issue with formatting which I think is related to this.
Produces this output to a file:
Output in the console is formatted correctly.
I think this still happens when using the
tailable: true
option.