How to use the configure function from log4js
Find comprehensive JavaScript log4js.configure code examples handpicked from public code repositorys.
GitHub: baetyl/baetyl-function
37 38 39 40 41 42 43 44 45 46
const name = logEvent.categoryName; const levelname = logEvent.level.levelStr; const message = logEvent.data; return `${asctime} - ${name} - ${levelname} - ${message}`; }); log4js.configure({ appenders: { file: { type: 'file', filename: mo.config.logger.path,
9
7
10
GitHub: hubrixco/logjack
18 19 20 21 22 23 24 25 26 27
} else ;// built-in layout } try{ log4js.configure(configuration); } catch(err){ console.log('Error: ' + err.message); }
2
15
4
GitHub: ken9320/OnlineOffice1
46 47 48 49 50 51 52 53 54 55 56 57
'credentialsFilename', 'settingsFilename', ]; // This is a function to make it easy to create a new instance. It is important to not reuse a // config object after passing it to log4js.configure() because that method mutates the object. :( const defaultLogConfig = () => ({appenders: [{type: 'console'}]}); const defaultLogLevel = 'INFO'; const initLogging = (logLevel, config) => {
0
0
1
+ 14 other calls in file
44 45 46 47 48 49 50 51 52 53
static setLogger(name, level) { addLayout('json', () => { return Logger.layout; }); configure({ appenders: { out: { type: 'console', layout: { type: 'json' }, }
0
0
4
+ 3 other calls in file
GitHub: pofresh/pofresh-logger
149 150 151 152 153 154 155 156 157 158
if (filename && config && config.reloadSecs) { initReloadConfiguration(filename, config.reloadSecs); } // config object could not turn on the auto reload configure file in log4js log4js.configure(config, opts); }; function replaceProperties(configObj, opts) { if (configObj instanceof Array) {
0
0
2
log4js.getLogger is the most popular function in log4js (529 examples)