Allow shutting down of appenders without disabling future log writes

This commit is contained in:
Raul Ochoa
2014-12-02 12:16:15 +01:00
parent ec5f4485f8
commit a669f7c2f4
2 changed files with 12 additions and 1 deletions
+3 -1
View File
@@ -80,7 +80,9 @@ function configure(config, options) {
}
function shutdown(cb) {
async.each(openFiles, function(file, done) {
var filesToClose = openFiles;
openFiles = [];
async.each(filesToClose, function(file, done) {
if (!file.write(eol, "utf-8")) {
file.once('drain', function() {
file.end(done);