File Transport maxsize is not working as expect
See original GitHub issueHi All,
I find that when I define the file transport with setting as followed
const logger = new (winston.Logger)({
transports: [
new (winston.transports.File)({
filename: config['log_file_name'],
dirname: '/data/tmp/',
//maxsize: 1000 * 1000 * 1024, // 1Gb
maxsize: 102400, // 100 kb
maxFiles: 1000,
timestamp: function() {
return Date.now()/1000|0;
}
})
],
exitOnError: false
})
then, the final log size will be 4 times than the maxsize.
404K rcv.log
400K rcv1.log
240K rcv2.log
According to the documentation, this result is not expected.
Thanks
Issue Analytics
- State:
- Created 8 years ago
- Reactions:2
- Comments:7 (1 by maintainers)
Top Results From Across the Web
NodeJS winston log file not change upon size limit
I'm expecting the app.log file to be rotated upon size reaching 10MB, but this has never happened and my log file grows to...
Read more >Local File logging driver - Docker Documentation
The local logging driver uses file-based storage. The file-format and ... The following example sets the log driver to local and sets the...
Read more >Node.js Logging with Winston - Reflectoring
In large applications, recording every log message into a single file is not a good idea. This makes tracking specific issues difficult. Using ......
Read more >Troubleshooting Client VPN - AWS Documentation
Unable to resolve Client VPN endpoint DNS name; Traffic is not being split ... Authorization rules for Active Directory groups not working as...
Read more >Chapter 23. Viewing and Managing Log Files
Using the Log Files to Troubleshoot Problems ... Mail Transport Protocols ... Output channels are primarily used to specify the maximum size 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
I use the following code for transport initialization:
And then:
##Expected result:
several files, each file as small as possible.
##Actual result:
one big file with all messages
I am facing same issue winston 2.2.1. It is also writing in last 2-3 rotated log files. Is there any fix for it?