fixed a issue with the encoding on node 0.8
This commit is contained in:
@@ -102,7 +102,7 @@ RollingFileSync.prototype.write = function(chunk, encoding) {
|
||||
function writeTheChunk() {
|
||||
debug("writing the chunk to the file");
|
||||
that.currentSize += chunk.length;
|
||||
fs.appendFileSync(that.filename, chunk, {encoding: encoding});
|
||||
fs.appendFileSync(that.filename, chunk);
|
||||
}
|
||||
|
||||
debug("in write");
|
||||
@@ -153,9 +153,8 @@ function fileAppender (file, layout, logSize, numBackups) {
|
||||
fs.appendFileSync(f, '');
|
||||
|
||||
return {
|
||||
write: function(data, encoding) {
|
||||
encoding = encoding || 'utf8';
|
||||
fs.appendFileSync(f, data, {encoding: encoding});
|
||||
write: function(data) {
|
||||
fs.appendFileSync(f, data);
|
||||
}
|
||||
};
|
||||
})(file);
|
||||
@@ -167,7 +166,7 @@ function fileAppender (file, layout, logSize, numBackups) {
|
||||
var logFile = openTheStream(file, logSize, numBackups);
|
||||
|
||||
return function(loggingEvent) {
|
||||
logFile.write(layout(loggingEvent) + eol, "utf8");
|
||||
logFile.write(layout(loggingEvent) + eol);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user