The Logging Framework for JavaScript with log4j configuration writes lines to a file that roll over when they reach a maximum size, or a date/time. You could provide any custom Appenders to write log messages wherever you need, it currently support loggin
Note: The Logging Framework for JavaScript with log4j configuration writes lines to a file that roll over when they reach a maximum size, or a date/time. You could provide any custom Appenders to write log messages wherever you need, it currently support logging messages to console and files.
type - "file", "dateFile" or "console". "file" means to log messages to a file; "dateFile" means to log messages to a file with datetime filename; "console" means to log messages to console.
layout - optional. "basic", "json" or an object(default: "basic"). "json" means to format a message to a JSON string.
fileName - when type is "dateFile", the date pattern must be configured in the file name.
maxLogSize - optional, use case insensitive k、m、g as unit
numBackups - optional, "10d" can be configured that means to back up logs for 10 days
level - optional, log level
categories
appenders - configure different appenders
level - log level
levels - log levels
level - log level
levels - "log4j", "syslog", Array. log levels
{
"appenders": {
"log1": { // getLogger('log1')"type":"file", // log messages to a file"layout":"json", // optional, not configured or json, or an object"fileName":"./logs/app.log", // log file path"maxLogSize":"10M", // optional, use case insensitive k、m、g as unit"numBackups":10// optional, "10d" can be configured that means to back up logs for 10 days
},
"log2": { // getLogger('log2')"type":"dateFile", // log messages to a file with a datetime file name"fileName":"./logs/log1-%d{YYYY-MM-DD}.log"// log file path with a datetime pattern
},
"log3": { // getLogger('log3')"type":"console", // log messages to console"layout": {
"datePattern":null// default: YYYY-MM-DD hh:mm:ss.SSS Z. null means ISOString formatter
}
}
},
"categories": {
"default": {
"appenders": [
"app"
],
"level":"ERROR"
},
"console": {
"appenders": [
"log2"
],
"level":"INFO"
},
"file": {
"appenders": [
"app",
"log2"
],
"level":"INFO"
},
"dateFile": {
"appenders": [
"log1",
"log2"
],
"level":"INFO"
}
},
"level":"ERROR", // optional, log lovel"levels":"syslog"// optional(default: "log4j"), "log4j", "syslog"
}
The Tidelift Subscription provides access to a continuously curated stream of human-researched and maintainer-verified data on open source packages and their licenses, releases, vulnerabilities, and development practices.