]>
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 path
= require('path')
7 var winston
= require('winston')
8 winston
.emitErrs
= true
10 var logDir
= path
.join(__dirname
, '..', config
.get('storage.logs'))
11 var logger
= new winston
.Logger({
13 new winston
.transports
.File({
15 filename: path
.join(logDir
, 'all-logs.log'),
16 handleExceptions: true,
22 new winston
.transports
.Console({
24 handleExceptions: true,
25 humanReadableUnhandledException: true,
34 write: function (message
, encoding
) {
39 // ---------------------------------------------------------------------------
41 module
.exports
= logger