bunyan-rotating-file-stream
bunyan-rotating-file-stream copied to clipboard
Rotating on period of ms are not working correctly
trafficstars
I added the following code:
const log = bunyan.createLogger({
name: 'bar',
streams: [{
type: 'raw',
stream: new RotatingFileStream({
path: './log/%Y-%m-%d.log',
period: '10ms',
totalFiles: 10,
rotateExisting: true,
threshold: '10m',
totalSize: '20m',
gzip: true
})
}]
});
However the log files are not being rotated every 10ms (the logs were written to the same file)
I'm pretty sure we can't actually do 10ms as the resolution of the timers involved is about 16ms in nodejs. I'm interested in what it's actually doing and what you'd expect to see. Is it not rotating the files at all?
Just trying to validate my code (waiting for 1d is taking too much time... (-:) - Bunyan documentation mentioned that 10ms (for development) is valid. The behaviour i'm experiencing it that the files are not rotated at all