Skip to content

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

@yongyan-foo

Description

@yongyan-foo

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'
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions