mirror of
https://github.com/log4js-node/log4js-node.git
synced 2025-12-08 19:26:01 +00:00
15 lines
496 B
JavaScript
15 lines
496 B
JavaScript
if (process.argv.indexOf('start-multiprocess-worker') >= 0) {
|
|
const log4js = require('../lib/log4js');
|
|
const port = parseInt(process.argv[process.argv.length - 1], 10);
|
|
log4js.configure({
|
|
appenders: {
|
|
multi: { type: 'multiprocess', mode: 'worker', loggerPort: port },
|
|
},
|
|
categories: { default: { appenders: ['multi'], level: 'debug' } },
|
|
});
|
|
log4js.getLogger('worker').info('Logging from worker');
|
|
log4js.shutdown(() => {
|
|
process.send('worker is done');
|
|
});
|
|
}
|