logm
v0.2.5
Published
file logger by Max
Downloads
2
Readme
File Logger for Node.js
@version 0.2.5
installation
npm install logm
usage
var logM = require('logm');
logM.configure('logM-config.json');
var logger = logM.getLogger('logger');
logger.log('this is a log');
logger.debug('this is a debug');
logger.warn('this is a warn');
logger.error('this is a error');
logger.trace('this is a trace');
config
loggers must be defined in config file, and pass the config file to configure
method.configure
must be called before getLogger
config file sample
{
"logger1": {
"exclude": [
"DEBUG"
],
logDir": "log/",
"filePrefix": "test"
},
"logger2": {
"exclude": [
"LOG", "WARN"
],
"logDir": "log/",
"filePrefix": "test"
},
"logger3": {
"logDir": "log/",
"filePrefix": "tesss"
},
"logger4": {
"logDir": "logg/",
"filePrefix": "test"
}
}
notify maintainer by mail
usage
var logger = logM.getLogger('logger');
logger.notifyMaintainer('[email protected]',
'subject',
'content');
annotation
- mail host is set to author Max [email protected]
- no matter how many mails with same subject in 30 min will only be sent once.
- if u want to send a specific mail ignore annotation 2, append a
true
param calling thenotifyMaintainer
method, which means no queue for this mail.