I use log4js and want to write error logs to a separate file. But all error levels are recorded for some reason only in the access file. And because of this, the errors file is empty. How to fix it?
log4js.json:
{
"appenders": {
"access": {
"type": "dateFile",
"filename": "logs/access.log",
"pattern": "-yyyy-MM-dd",
"category": "http"
},
"app": {
"type": "file",
"filename": "logs/project.log",
"maxLogSize": 10485760,
"numBackups": 3
},
"errorFile": {
"type": "file",
"filename": "logs/errors.log"
},
"errors": {
"type": "logLevelFilter",
"level": "ERROR",
"appender": "errorFile"
}
},
"categories": {
"default": { "appenders": [ "app", "errors" ], "level": "DEBUG" },
"http": { "appenders": [ "access"], "level": "DEBUG" }
}
}