2.0.1 • Published 10 years ago
mangabi-logger v2.0.1
Mangabi Logger
WinstonJS logger with defaults defaults set for use by Mangabi.com
Installation
var logger = require('mangabi-logger')
Upgrading from version 1.0 to 2.0
In version 2 the default log level names have been changed to match the syslog
levels in specified in RFC5424. All logging statments should be changed, but
specifically silly, verbose, warn, and fatal no longer exist on the logger object.
Defaults
Colors
logger.debug('Blue')
logger.info('Green')
logger.notice('Green')
logger.warning('Yellow')
logger.error('Yellow')
logger.crit('Magenta')
logger.alert('Magenta')
logger.emerg('Red')
Transports
Development
- Console Transport with color and pretty-printing.
LOG_LEVELdefaults to debug
Test
- No logging unless
LOG_LEVELis set. IfLOG_LEVELis set then dev logging will be used
Production and Stage
- Console Transport with timestamp and exception handling.
LOG_LEVELdefaults to info
Customization
LOG_LEVELenvironment variable can be set to debug, info, notice, warning, error, crit, alert, or emerg. Any logs below this level will be ignored.NODE_ENVwill determine which transports are used.