aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/logger.js
diff options
context:
space:
mode:
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,