fixed log rolling problem
This commit is contained in:
@@ -295,12 +295,6 @@ function fileAppender (file, layout, logSize, numBackups, filePollInterval) {
|
||||
//close the file on process exit.
|
||||
process.on('exit', function() {
|
||||
logFile.end();
|
||||
//node v0.2.x does not have destroySoon
|
||||
if (logFile.destroySoon) {
|
||||
logFile.destroySoon();
|
||||
} else {
|
||||
logFile.destroy();
|
||||
}
|
||||
});
|
||||
|
||||
return function(loggingEvent) {
|
||||
@@ -326,11 +320,6 @@ function setupLogRolling (logFile, filename, logSize, numBackups, filePollInterv
|
||||
function rollThatLog (logFile, filename, numBackups) {
|
||||
//first close the current one.
|
||||
logFile.end();
|
||||
if (logFile.destroySoon) {
|
||||
logFile.destroySoon();
|
||||
} else {
|
||||
logFile.destroy();
|
||||
}
|
||||
//roll the backups (rename file.n-1 to file.n, where n <= numBackups)
|
||||
for (var i=numBackups; i > 0; i--) {
|
||||
if (i > 1) {
|
||||
|
||||
Reference in New Issue
Block a user