]>
git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - src/logger.js
2 // Thanks http://tostring.it/2014/06/23/advanced-logging-with-nodejs/
6 var winston
= require('winston')
7 var config
= require('config')
9 var logDir
= __dirname
+ '/../' + config
.get('storage.logs')
11 winston
.emitErrs
= true
13 var logger
= new winston
.Logger({
15 new winston
.transports
.File({
17 filename: logDir
+ '/all-logs.log',
18 handleExceptions: true,
24 new winston
.transports
.Console({
26 handleExceptions: true,
27 humanReadableUnhandledException: true,
35 module
.exports
= logger
36 module
.exports
.stream
= {
37 write: function (message
, encoding
) {