Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rotating on period of ms are not working correctly #16

Open
adi-biton-bitmain opened this issue Feb 5, 2018 · 2 comments
Open

Rotating on period of ms are not working correctly #16

adi-biton-bitmain opened this issue Feb 5, 2018 · 2 comments

Comments

@adi-biton-bitmain
Copy link

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)

@Rcomian
Copy link
Owner

Rcomian commented Feb 6, 2018

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?

@adi-biton-bitmain
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants