mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01:00
Merge branch 'fix-logger' of https://github.com/pierreozoux/wekan into pierreozoux-fix-logger
This commit is contained in:
commit
a64dbc4a9b
1 changed files with 6 additions and 9 deletions
|
|
@ -3,21 +3,20 @@ Meteor.startup(() => {
|
||||||
require('winston-zulip');
|
require('winston-zulip');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
|
||||||
const loggerEnable = process.env.LOGGER_ENABLE || false;
|
//remove default logger
|
||||||
|
Winston.remove(Winston.transports.Console);
|
||||||
|
|
||||||
|
const loggerEnable = process.env.LOGGER_ENABLE || true;
|
||||||
if (loggerEnable) {
|
if (loggerEnable) {
|
||||||
|
|
||||||
Winston.log('info', 'logger is enable');
|
Winston.log('info', 'logger is enable');
|
||||||
const loggers = process.env.LOGGERS.split(',') || 'console';
|
const loggers = process.env.LOGGERS ? process.env.LOGGERS.split(',') : 'console'
|
||||||
Winston.log('info', `Loggers selected : ${ process.env.LOGGERS }, if empty default is console`);
|
|
||||||
|
|
||||||
if (loggers.includes('console')) {
|
if (loggers.includes('console')) {
|
||||||
Winston.add(Winston.transports.Console, {
|
Winston.add(Winston.transports.Console, {
|
||||||
json: true,
|
json: true,
|
||||||
timestamp: true,
|
timestamp: true,
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
//remove default logger
|
|
||||||
Winston.remove(Winston.transports.Console);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (loggers.includes('file')) {
|
if (loggers.includes('file')) {
|
||||||
|
|
@ -57,10 +56,8 @@ Meteor.startup(() => {
|
||||||
Winston.log('info', `zulipconfig ${zulipConfig}`);
|
Winston.log('info', `zulipconfig ${zulipConfig}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
|
||||||
//remove default logger
|
|
||||||
Winston.remove(Winston.transports.Console);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Winston.log('info', 'Logger is completly instanciate');
|
Winston.log('info', 'Logger is completly instanciate');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue