Tuesday, 1 October 2019

write logs with log4js in new diffrent files?

I want to write the logs into different files.

const log4js = require('log4js');
log4js.configure({
    appenders: { integra: { type: 'file', filename: './logs/doc.log' } },
    categories: { default: { appenders: ['doc'], level: 'error' } }
});
const logger = log4js.getLogger('doc');

module.exports = logger

As per the code above, I can configure logs one time only. But I want to write a log file dynamcally for every log. In above case, I can write a single file only. I need a way by which I can write a new log file. I want to write multiple logs files at different paths.



from write logs with log4js in new diffrent files?

No comments:

Post a Comment