使用下面提到的log4js配置,我打算将所有内容记录到logs / test / log- timestamp .txt文件中的文件中,并且仅将INFO级别记录到控制台中,但是我看到了控制台将打印所有级别。我该如何解决?
{
"appenders": {
"test": {
"type": "dateFile",
"filename": "logs/test/log",
"pattern": "-yyyy-MM-dd-hh-mm-ss.txt",
"alwaysIncludePattern": true,
"keepFileExt": true
},
"test-filter": {
"type": "logLevelFilter",
"appender": "test",
"level": "trace",
"maxLevel": "fatal"
},
"default": {
"type": "dateFile",
"filename": "logs/default",
"pattern": "-yyyy-MM-dd.txt",
"alwaysIncludePattern": true,
"keepFileExt": true
},
"console": {
"type": "console",
"level": "info",
"maxLevel": "info"
}
},
"categories": {
"default": {
"appenders": [
"default"
],
"level": "info"
},
"test": {
"appenders": [
"test-filter",
"console"
],
"level": "debug"
}
}
}