aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/logger.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-08-19 21:34:51 +0200
committerChocobozzz <florian.bigard@gmail.com>2016-08-19 21:34:51 +0200
commite861452fb26553177ad4e32bfb18b4fd8a5b1816 (patch)
tree7c0cfd464709243a452b431665f5107a973df682 /server/helpers/logger.js
parent5c39adb7313e0696aabb4b71196ab7b0b378c359 (diff)
downloadPeerTube-e861452fb26553177ad4e32bfb18b4fd8a5b1816.tar.gz
PeerTube-e861452fb26553177ad4e32bfb18b4fd8a5b1816.tar.zst
PeerTube-e861452fb26553177ad4e32bfb18b4fd8a5b1816.zip
Server: put config in constants
Diffstat (limited to 'server/helpers/logger.js')
-rw-r--r--server/helpers/logger.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/server/helpers/logger.js b/server/helpers/logger.js
index 8ae90a4b2..590ceaeb6 100644
--- a/server/helpers/logger.js
+++ b/server/helpers/logger.js
@@ -1,23 +1,23 @@
1// Thanks http://tostring.it/2014/06/23/advanced-logging-with-nodejs/ 1// Thanks http://tostring.it/2014/06/23/advanced-logging-with-nodejs/
2'use strict' 2'use strict'
3 3
4const config = require('config')
5const mkdirp = require('mkdirp') 4const mkdirp = require('mkdirp')
6const path = require('path') 5const path = require('path')
7const winston = require('winston') 6const winston = require('winston')
8winston.emitErrs = true 7winston.emitErrs = true
9 8
10const logDir = path.join(__dirname, '..', '..', config.get('storage.logs')) 9const constants = require('../initializers/constants')
11const label = config.get('webserver.host') + ':' + config.get('webserver.port') 10
11const label = constants.CONFIG.WEBSERVER.HOST + ':' + constants.CONFIG.WEBSERVER.PORT
12 12
13// Create the directory if it does not exist 13// Create the directory if it does not exist
14mkdirp.sync(logDir) 14mkdirp.sync(constants.CONFIG.STORAGE.LOG_DIR)
15 15
16const logger = new winston.Logger({ 16const logger = new winston.Logger({
17 transports: [ 17 transports: [
18 new winston.transports.File({ 18 new winston.transports.File({
19 level: 'debug', 19 level: 'debug',
20 filename: path.join(logDir, 'all-logs.log'), 20 filename: path.join(constants.CONFIG.STORAGE.LOG_DIR, 'all-logs.log'),
21 handleExceptions: true, 21 handleExceptions: true,
22 json: true, 22 json: true,
23 maxsize: 5242880, 23 maxsize: 5242880,