fixed a issue with the encoding on node 0.8

This commit is contained in:
Maycon Bordin
2013-12-12 22:26:48 -02:00
parent 60a84f16cf
commit 7fcdb2e651
2 changed files with 17 additions and 37 deletions

View File

@@ -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);
};
}