Skip to content

Can I disable console output and only leave file output? #65

@amirsaranBIH

Description

@amirsaranBIH

I am trying to create a system where in development mode I write errors to log files and also to the console, but in production I only want to write to log file.

This is how my logger looks like:

export const Log = simpleNodeLogger.createRollingFileLogger({
    errorEventName: 'error',
    logDirectory: 'logs',
    fileNamePattern: 'log-<DATE>.log',
    dateFormat: 'YYYY-MM-DD'
});

if (process.env.NODE_ENV === 'production') {
    // disable console output, only leave file write
}

I haven't found any config parameters for disabling console logging. I also tried using appenders, but I don't understand them at all and I didn't have luck.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions