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

How do I make my files append instead of overwriting when logging? #367

Open
yongyan-foo opened this issue Jan 31, 2023 · 2 comments
Open

Comments

@yongyan-foo
Copy link

yongyan-foo commented Jan 31, 2023

This is my configuration, I am able to create a log flow, but everytime my appliation resets, it deletes the existing logs. How can I make it append if the file already exists.

Here is my Configuration

const fileTransportOptions : DailyRotateFileTransportOptions = { 
    filename: `${process.env.LOG_DIR}/${process.env.APPLICATION_NAME}-%DATE%.log`,
    level: process.env.LOG_LEVEL??"info",
    datePattern: "YYYY-MM-DD",
    maxFiles: 365, 
    maxSize: "30mb", 
    zippedArchive: true,
    utc: true,
    options: { 
        flags: 'a'
    }
}
@gustav87
Copy link

I'm also having this issue. I don't pass any options, and it should default to appending, but it still overwrites the previous log file on restart.

@bbrodbeck-memtime
Copy link

having same problem. It just removes the previous log file(s) instead of reusing it and appending new entries. This is quite annoying as we loose important logging information.

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

3 participants