Skip to content

How to set the default log level? #436

@stayknight

Description

@stayknight

I have some log4js config like this:
var config = { appenders:[ { type:"console" }, { type: "file", filename: "file.log", maxLogSize: 20480, backups: 10 } ], replaceConsole: true, levels: {} }
and used as :
var logger = log4js.getLogger();

It works fine with logs output to console and file.log. The log content from console.log() is replaced with log4js style with log level 'INFO' as I learned. But when I call logger.setLevel('ERROR'); immedidately after calling getLogger(), the logs from console.log() are still present, both in the console and file.log. Shouldn't they disapprear after I restart the application?

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