seanmonstar / intel

I need more intel!
http://seanmonstar.github.io/intel/
Mozilla Public License 2.0
202 stars 26 forks source link

How to use log to file? Please more example #54

Closed freenetwork closed 6 years ago

freenetwork commented 6 years ago

var intel = require('intel'); //intel.addHandler(new intel.handlers.File('r.log')); //intel.addHandler(new intel.Formatter('[%(date)s] %(name)s.%(levelname)s: %(message)s'));

intel.config({ formatters: { 'details': { 'format': '[%(date)s] %(name)s.%(levelname)s: %(message)s', 'strip': true } }, handlers: { 'logfile': { 'class': intel.handlers.File, 'file': 'log.log', 'formatter': 'details', } } });

intel.warn('hello');

freenetwork commented 6 years ago

intel.basicConfig({ 'format': '[%(date)s] %(name)s.%(levelname)s: %(message)s', 'file': 'report.log', });