logdapter
The simple winston based logging adapter using in devebot.
Usage
Installs logdapter
module:
$ npm install --save logdapter
Creates a logdapter object and initializes it:
var Logdapter = ;var logdapter =logger:transports:type: 'console'level: 'trace'type: 'logstash'level: 'trace'host: '127.0.0.1'port: 28777;var logger = logdapter;
Uses the helper methods to log messages:
logger;logger;logger;logger;logger;
Change logger's level
To change logger level at runtime, you should use the setLevel() method:
// ... code that uses old loglevel// set 'error' level to all transportslogger;// set 'trace' level to only 'console' transportlogger;// set 'debug' level to both 'console' and 'mongodb' transportslogger;// ... code that uses new loglevel
You can reset all logger transport levels to default levels:
logger;
Enable/disable transports
To disable the transports at runtime, use the follow method call:
// disable the logstash transportlogger;// or the list of transportslogger;
To enable the tranports at runtime, use the true
value in activate()
method:
// enable the logstash transportlogger;// or the list of transportslogger;