seanmonstar / intel

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

app hang when log exception exceed file size #27

Closed hcheng2002cn closed 10 years ago

hcheng2002cn commented 10 years ago

application will hang when log exception exceed file size.

lib/logger.js const intel = require('intel')

var init = function() { intel.addHandler(new intel.handlers.Rotating({ maxSize: 500, maxFiles: 4, formatter: new intel.Formatter("[%(date)s] %(levelname)s %(name)s: %(message)s"), file: '/Users/hcheng/project/node-test/app.log'})); require('intel').console(); intel.getLogger('Exception').handleExceptions();

}

exports.init = init;

lib/testlog.js var test = function() { myvar = "test"; console.log( myvar, "Logged!"); console.info( myvar, "Logged!"); console.warn( myvar, "Logged!"); console.debug(myvar, "Logged!"); console.error(myvar, "Logged!"); b // will generate exception }

exports.test = test;

app.js require('./lib/logger.js').init(); require('./lib/testlog.js').test(); console.log("Server running at http://127.0.0.1:8000/");

seanmonstar commented 10 years ago

Yikes. Thanks for reporting this. What version of intel are you using?

hcheng2002cn commented 10 years ago

I installed from npm. npm list:

intel@1.0.0-b2

Thanks,

hong

2014-05-21 21:06 GMT-07:00 Sean McArthur notifications@github.com:

Yikes. Thanks for reporting this. What version of intel are you using?

— Reply to this email directly or view it on GitHubhttps://github.com/seanmonstar/intel/issues/27#issuecomment-43846686 .

seanmonstar commented 10 years ago

Ok, the error is that the formatted message includes the stack trace, and combined, its ~800 bytes. You've set the max size at 500, so it just keeps rotating to a new file forever.

hcheng2002cn commented 10 years ago

Thanks,

Hong

2014-05-26 8:12 GMT-07:00 Sean McArthur notifications@github.com:

Ok, the error is that the formatted message includes the stack trace, and combined, its ~800 bytes. You've set the max size at 500, so it just keeps rotating to a new file forever.

— Reply to this email directly or view it on GitHubhttps://github.com/seanmonstar/intel/issues/27#issuecomment-44197152 .

hcheng2002cn commented 10 years ago

thanks

2014-07-08 18:42 GMT-07:00 Sean McArthur notifications@github.com:

Closed #27 https://github.com/seanmonstar/intel/issues/27.

— Reply to this email directly or view it on GitHub https://github.com/seanmonstar/intel/issues/27#event-139517240.