Set the global level via the configuration object passed to
log4js.configure or target `all` in the `levels` object.
This commit is contained in:
parent
94034e1226
commit
25fa48ee8d
@ -166,6 +166,9 @@ function configureLevels(levels) {
|
||||
if (levels) {
|
||||
for (var category in levels) {
|
||||
if (levels.hasOwnProperty(category)) {
|
||||
if(category === "all") {
|
||||
setGlobalLogLevel(levels[category]);
|
||||
}
|
||||
getLogger(category).setLevel(levels[category]);
|
||||
}
|
||||
}
|
||||
@ -173,8 +176,10 @@ function configureLevels(levels) {
|
||||
}
|
||||
|
||||
function setGlobalLogLevel(level) {
|
||||
if(level) {
|
||||
Logger.prototype.level = levels.toLevel(level, levels.TRACE);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the default logger instance.
|
||||
@ -199,6 +204,7 @@ function configureOnceOff(config, options) {
|
||||
try {
|
||||
configureAppenders(config.appenders, options);
|
||||
configureLevels(config.levels);
|
||||
setGlobalLogLevel(config.globalLevel);
|
||||
|
||||
if (config.replaceConsole) {
|
||||
replaceConsole();
|
||||
|
Loading…
Reference in New Issue
Block a user