Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Logs not flushing to file on process.exit #122

Closed
stormherz opened this Issue Mar 11, 2013 · 4 comments

Comments

Projects
None yet
3 participants

Problem, described in pull request #65, logging something to file appender and ending process right after results in missing logs.

Owner

nomiddlename commented Apr 8, 2014

@jengler has fixed this issue in 0.6.13 - you have to wrap your process.exit in a call to log4js.shutdown, to give log4js file streams a chance to finish writing.

log4js.shutdown(function() { process.exit(); });

@danie11am danie11am referenced this issue Jun 16, 2014

Merged

Flush on exit #195

Contributor

despairblue commented Apr 6, 2016

@nomiddlename does this also flush to loggly? I was trying to find a way to flush messages to loggly before exiting, and it seems the only viable solution is setTimeout.

Owner

nomiddlename commented Apr 14, 2016

The Loggly appender doesn't register a shutdown function, which is probably the issue there.

Contributor

despairblue commented Apr 15, 2016

@nomiddlename would you welcome a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment