use os.EOL instead of \n
This commit is contained in:
parent
3cbae96a97
commit
638ce187bb
@ -1,7 +1,8 @@
|
||||
var layouts = require('../layouts')
|
||||
, path = require('path')
|
||||
, fs = require('fs')
|
||||
, streams = require('../streams');
|
||||
, streams = require('../streams')
|
||||
, os = require('os');
|
||||
|
||||
/**
|
||||
* File Appender writing the logs to a text file. Supports rolling of logs by size.
|
||||
@ -46,7 +47,7 @@ function fileAppender (file, layout, logSize, numBackups) {
|
||||
});
|
||||
|
||||
return function(loggingEvent) {
|
||||
logFile.write(layout(loggingEvent)+'\n', "utf8");
|
||||
logFile.write(layout(loggingEvent)+os.EOL, "utf8");
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
var dateFormat = require('./date_format')
|
||||
, os = require('os')
|
||||
, util = require('util')
|
||||
, replacementRegExp = /%[sdj]/g
|
||||
, layoutMakers = {
|
||||
@ -197,7 +198,7 @@ function patternLayout (pattern) {
|
||||
replacement = formatLogData(loggingEvent.data);
|
||||
break;
|
||||
case "n":
|
||||
replacement = "\n";
|
||||
replacement = os.EOL;
|
||||
break;
|
||||
case "p":
|
||||
replacement = loggingEvent.level.toString();
|
||||
|
Loading…
Reference in New Issue
Block a user