Log files not rotating after exceeding maxsize threshold
See original GitHub issueI set my maxsize in a congif file as 300 and my code is the following:
'use strict'
import winston from 'winston'
import config from '../../config/environment'
export default winston.createLogger({
level: 'info',
format: winston.format.printf(info => info.message),
transports: [
new winston.transports.Console(),
new winston.transports.File({
filename: `${config.logsPath}/express.error.log`,
maxsize: config.logMaxSize,
level: 'error'
}),
new winston.transports.File({
filename: `${config.logsPath}/express.log`,
maxsize: config.logMaxSize
})]
})
None of this files are rotating after they reach the 300 bytes threshold.
I even tried setting the 300 manually instead of making a reference to the config file.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:6
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Logrotate not rotating file after file size exceeds the limit.
According to the man page, logrotate should rotate file if the configuration is based on logs size. But, my file is not getting...
Read more >Winston js. My log files aren't rotating after exceeding maxsize
Basically, once over the maxsize threshold, internal self.filename variable was not being updated so _createStream would re-open the append ...
Read more >Logrotate daily+maxsize is not rotating - Unix StackExchange
I want the log to be rotated daily or if the size reaches 50MB. When this happens log files are compressed and copied...
Read more >Why logrotate maxsize condition is not working? - Super User
In the logrotate manual page there is no "maxsize" option, just "size" and "minsize". enter image description here.
Read more >How to Rotate and Compress Log Files in Linux with Logrotate
The statement implies that log files bigger than 40 Megabytes will be rotated without any regard for the time interval of rotation. This...
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
Yes
maxsize
should 100% work as expected – we added tests for this feature in https://github.com/winstonjs/winston/pull/1236Aha Ok Thanks.