1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 02:09:37 +02:00

Prepare folders structure for angular app

This commit is contained in:
Chocobozzz 2016-03-07 11:33:59 +01:00
parent b2ff5e3e68
commit b9a3e09ad5
60 changed files with 13 additions and 86 deletions

40
server/helpers/logger.js Normal file
View file

@ -0,0 +1,40 @@
// Thanks http://tostring.it/2014/06/23/advanced-logging-with-nodejs/
'use strict'
var config = require('config')
var path = require('path')
var winston = require('winston')
winston.emitErrs = true
var logDir = path.join(__dirname, '..', config.get('storage.logs'))
var logger = new winston.Logger({
transports: [
new winston.transports.File({
level: 'debug',
filename: path.join(logDir, 'all-logs.log'),
handleExceptions: true,
json: true,
maxsize: 5242880,
maxFiles: 5,
colorize: false
}),
new winston.transports.Console({
level: 'debug',
handleExceptions: true,
humanReadableUnhandledException: true,
json: false,
colorize: true
})
],
exitOnError: true
})
logger.stream = {
write: function (message, encoding) {
logger.info(message)
}
}
// ---------------------------------------------------------------------------
module.exports = logger