plyo-tools
Advanced tools
Comparing version 3.1.2 to 3.1.3
@@ -29,2 +29,3 @@ 'use strict'; | ||
var logger = _winston2.default.createLogger({ | ||
format: _winston.format.combine(_winston.format.splat(), _winston.format.simple()), | ||
transports: [new Console({ | ||
@@ -46,40 +47,40 @@ level: 'verbose', | ||
function setup(options) { | ||
if (options.useFileTransports) { | ||
var dirname = _path2.default.resolve(_path2.default.dirname(require.main.filename), '../logs'); | ||
logger.add(File, { | ||
name: 'all', // we need to specify names because we have two transports of the same type | ||
level: 'debug', // default max level is "info", we want to write "verbose" as well | ||
filename: 'all.log', | ||
dirname: dirname, | ||
maxsize: 1000000, // 1Mb | ||
maxFiles: 100, | ||
tailable: true, // the latest logs are always into `all.log`, older messages go to `all.1.log`, ..., `all.n.log` | ||
json: false, // it's too hard for human to read json-encoded sql requests | ||
handleExceptions: true | ||
}).add(File, { | ||
name: 'errors', | ||
filename: 'errors.log', | ||
dirname: dirname, | ||
level: 'error', // only errors go here. Useful for quick look on prod env etc. | ||
maxsize: 1000000, // 1Mb | ||
maxFiles: 100, | ||
tailable: true, | ||
json: false, | ||
handleExceptions: true | ||
}).add(File, { | ||
name: 'logstash', | ||
filename: 'logstash.log', | ||
dirname: dirname, | ||
level: options.logstashTransportLevel || 'verbose', | ||
maxsize: 1000000, // 1Mb | ||
maxFiles: 100, | ||
tailable: true, | ||
logstash: true, | ||
handleExceptions: true | ||
}); | ||
} | ||
// if (options.useFileTransports) { | ||
var dirname = _path2.default.resolve(_path2.default.dirname(require.main.filename), '../logs'); | ||
logger.add(new File({ | ||
name: 'all', // we need to specify names because we have two transports of the same type | ||
level: 'debug', // default max level is "info", we want to write "verbose" as well | ||
filename: 'all.log', | ||
dirname: dirname, | ||
maxsize: 1000000, // 1Mb | ||
maxFiles: 100, | ||
tailable: true, // the latest logs are always into `all.log`, older messages go to `all.1.log`, ..., `all.n.log` | ||
json: false, // it's too hard for human to read json-encoded sql requests | ||
handleExceptions: true | ||
})).add(new File({ | ||
name: 'errors', | ||
filename: 'errors.log', | ||
dirname: dirname, | ||
level: 'error', // only errors go here. Useful for quick look on prod env etc. | ||
maxsize: 1000000, // 1Mb | ||
maxFiles: 100, | ||
tailable: true, | ||
json: false, | ||
handleExceptions: true | ||
})).add(new File({ | ||
name: 'logstash', | ||
filename: 'logstash.log', | ||
dirname: dirname, | ||
level: options.logstashTransportLevel || 'verbose', | ||
maxsize: 1000000, // 1Mb | ||
maxFiles: 100, | ||
tailable: true, | ||
logstash: true, | ||
handleExceptions: true | ||
})); | ||
// } | ||
if (options.consoleTransportLevel) { | ||
logger.transports.console.level = options.consoleTransportLevel; | ||
logger.transports[0].level = options.consoleTransportLevel; | ||
} | ||
} |
{ | ||
"version": "3.1.2", | ||
"version": "3.1.3", | ||
"name": "plyo-tools", | ||
@@ -4,0 +4,0 @@ "repository": "plyo/plyo.tools", |
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
23398
153
649