bunyan-rotating-file-stream icon indicating copy to clipboard operation
bunyan-rotating-file-stream copied to clipboard

Rotating on period of ms are not working correctly

Open adi-biton-bitmain opened this issue 7 years ago • 2 comments
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)

adi-biton-bitmain avatar Feb 05 '18 15:02 adi-biton-bitmain

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?

Rcomian avatar Feb 06 '18 11:02 Rcomian

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

adi-biton-bitmain avatar Feb 06 '18 21:02 adi-biton-bitmain