egg-logger
Advanced tools
Comparing version 1.6.0 to 1.6.1
1.6.1 / 2017-12-27 | ||
================== | ||
**fixes** | ||
* [[`f0bf7d9`](http://github.com/eggjs/egg-logger/commit/f0bf7d97e269da3ff29f2a6f811f1b48558fbcab)] - fix(transport): should reload write stream when stream get error (#21) (Haoliang Gao <<sakura9515@gmail.com>>) | ||
1.6.0 / 2017-04-28 | ||
@@ -3,0 +9,0 @@ ================== |
@@ -99,3 +99,11 @@ 'use strict'; | ||
const stream = fs.createWriteStream(this.options.file, { flags: 'a' }); | ||
const onError = err => { | ||
console.error('%s ERROR %s [egg-logger] [%s] %s', | ||
utility.logDate(','), process.pid, this.options.file, err.stack); | ||
this.reload(); | ||
console.warn('%s WARN %s [egg-logger] [%s] reloaded', utility.logDate(','), process.pid, this.options.file); | ||
}; | ||
stream.on('error', onError); | ||
stream._onError = onError; | ||
return stream; | ||
@@ -111,3 +119,3 @@ } | ||
this._stream.end(); | ||
this._stream.removeListener('error', onError); | ||
this._stream.removeListener('error', this._stream._onError); | ||
this._stream = null; | ||
@@ -120,6 +128,1 @@ } | ||
module.exports = FileTransport; | ||
function onError(err) { | ||
console.error('%s ERROR %s [chair-logger:buffer_write_stream] %s: %s\n%s', | ||
utility.logDate(','), process.pid, err.name, err.message, err.stack); | ||
} |
{ | ||
"name": "egg-logger", | ||
"version": "1.6.0", | ||
"version": "1.6.1", | ||
"description": "egg logger", | ||
@@ -23,5 +23,7 @@ "main": "index.js", | ||
"eslint-config-egg": "^3.2.0", | ||
"heapdump": "^0.3.9", | ||
"ko-sleep": "^1.0.2", | ||
"koa": "^1.3.0", | ||
"mm": "^2.1.0", | ||
"mz-modules": "^2.0.0", | ||
"rimraf": "^2.6.1", | ||
@@ -52,3 +54,3 @@ "should": "^11.2.1", | ||
"ci": { | ||
"version": "4, 6, 7", | ||
"version": "4, 6, 8, 9", | ||
"license": true | ||
@@ -55,0 +57,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
37594
19
977
0
16