]>
git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - helpers/logger.js
2 // Thanks http://tostring.it/2014/06/23/advanced-logging-with-nodejs/
5 var config
= require('config')
6 var winston
= require('winston')
7 winston
.emitErrs
= true
9 var logDir
= __dirname
+ '/../' + config
.get('storage.logs')
10 var logger
= new winston
.Logger({
12 new winston
.transports
.File({
14 filename: logDir
+ '/all-logs.log',
15 handleExceptions: true,
21 new winston
.transports
.Console({
23 handleExceptions: true,
24 humanReadableUnhandledException: true,
33 write: function (message
, encoding
) {
38 // ---------------------------------------------------------------------------
40 module
.exports
= logger