How to use the shutdown function from log4js

Find comprehensive JavaScript log4js.shutdown code examples handpicked from public code repositorys.

92
93
94
95
96
97
98
};
exports.fatal = function (){
        return logger.fatal.apply(logger, Array.prototype.slice.call(arguments));
};
exports.shutdown = function (callback) {
        return log4js.shutdown(callback);
};
fork icon182
star icon152
watch icon33

+ 3 other calls in file

281
282
283
284
285
286
287
288
289
290
291
292
293
const cleanup = () => {
  log.info("Shutting down...");


  storeSettings();


  log4js.shutdown();
};


let win;

fork icon2
star icon15
watch icon0

31
32
33
34
35
36
37
38
39
40
get logger(){
    return this.baseLogger;
}

shutdown(){
    log4js.shutdown(this.postShutdown());
}
postShutdown(){
    ;
}
fork icon2
star icon15
watch icon4

62
63
64
65
66
67
68
69
70
71
72
  console.log = (msg) => logger.trace(msg);
  console.info = (msg) => logger.debug(msg);
  console.warn = (msg) => logger.warn(msg);
  console.error = (msg) => logger.error(msg);


  logger.shutdown = log4js.shutdown;
  return logger;
}
// ==============================================
function configureConsole() {
fork icon0
star icon0
watch icon0

44
45
46
47
48
49
50
51
  },
};


module.exports = {
  logger,
  log4js, // 同时导出实例,可通过 log4js.shutdown() 关闭日志
};
fork icon0
star icon0
watch icon0