How to use the loggers function from winston

Find comprehensive JavaScript winston.loggers code examples handpicked from public code repositorys.

162
163
164
165
166
167
168
169
170
171
if (this.session_mgr)
    this.session_mgr.stop();
opt = this.opt = Object.assign({}, this.opt, opt);
this.logger = require('./logger.js').child({category: `[${opt.port}]`});
this.logger.set_level(opt.log);
this.req_logger = winston.loggers.get('reqs');
if (opt.zagent && opt.logs_settings)
    this.remote_logger = this.logger.create_remote(opt.logs_settings);
this.reverse_lookup = null;
if (opt.reverse_lookup_dns===true)
fork icon183
star icon600
watch icon53

+ 8 other calls in file

1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
 if (!_this.argv.zagent)
     return res.send('Available only in Cloud Proxy Manager');
 let type = req.body.type;
if (!type || !logger.remote_transports[type])
     return res.send('Bad parameters');
 let test_logger = winston.loggers.get('test');
 let transport = logger.remote_transports[type].create_fn(req.body);
 transport.on('warn', e=>{
     logger.warn('Logs transport test error: ' + e.message);
     this.continue(e.message);
fork icon183
star icon600
watch icon53

+ 8 other calls in file

27
28
29
30
31
32
33
34
35
36
    return;
}

if (domain !== 'localhost') {
    //get the existing or created instance
    let domainLogger = winston.loggers.get(`${domain}`)
    if (logger.logLevels.levels[type]) {
        domainLogger.log(type, message, { timestamp: new Date().toISOString(), userid: payload.headers.userid, domain: payload.headers.domain, method: payload.method, url: payload.url })
    }
}
fork icon0
star icon0
watch icon1