Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// $ExpectError
log4js.configure({
appenders: [{}],
});
log4js.getLogger().log('test');
log4js.getLogger('test').error('test', 'test');
// $ExpectError
log4js.getLogger('test').test('test');
// $ExpectError
log4js.getLogger(1);
log4js.shutdown(() => {});
// $ExpectError
log4js.shutdown();
log4js.connectLogger(log4js.getLogger(), {});
const error = log4js.levels.ERROR;
process.on('unhandledRejection', error => {
log4js.getLogger().fatal('Unhandled rejection:', error);
log4js.shutdown(() => process.exit(1));
});
process.on('unhandledRejection', error => {
log4js.getLogger().fatal('Unhandled rejection:', error);
log4js.shutdown(() => process.exit(1));
});
function done() {
if (_shutdownTimer) clearTimeout(_shutdownTimer);
logger.info("Exiting after all tasks ended, pid: " + process.pid + " code: " + (code || 0) + " (code=1 means hard)");
log4js.shutdown(function() {
process.exit(code || 0);
});
}
var data = {
shutdown(){
log4js.shutdown(this.postShutdown());
}
postShutdown(){
logger.shutdown = (callback) => {
log4js.shutdown(callback);
}
export function flushLogsAndAbort(): void {
log4js.shutdown(() => process.abort());
}
N.logger.shutdown = function (cb) {
log4js.shutdown(cb);
};
thelogger.shutdown = function(cb) {
log4js.shutdown(cb);
}
return thelogger;
process.on('uncaughtException', err => {
logger.fatal('Uncaught exception:', err);
log4js.shutdown(() => process.abort());
});