aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/logger.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-05-01 09:58:34 +0200
committerChocobozzz <florian.bigard@gmail.com>2016-05-01 09:58:34 +0200
commit320d6275447414e29776a26200351445be5a78a2 (patch)
tree1fbe7ecd270f16b0398b30acc4f5d502f632e0be /server/helpers/logger.js
parent2eb5a041b3fa82074784ae907d2c084d41411d2b (diff)
downloadPeerTube-320d6275447414e29776a26200351445be5a78a2.tar.gz
PeerTube-320d6275447414e29776a26200351445be5a78a2.tar.zst
PeerTube-320d6275447414e29776a26200351445be5a78a2.zip
Ensure the log directory is created before instanciate the logger
Diffstat (limited to 'server/helpers/logger.js')
-rw-r--r--server/helpers/logger.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/server/helpers/logger.js b/server/helpers/logger.js
index d3fce4cc9..4ff61380b 100644
--- a/server/helpers/logger.js
+++ b/server/helpers/logger.js
@@ -2,11 +2,16 @@
2'use strict' 2'use strict'
3 3
4const config = require('config') 4const config = require('config')
5const mkdirp = require('mkdirp')
5const path = require('path') 6const path = require('path')
6const winston = require('winston') 7const winston = require('winston')
7winston.emitErrs = true 8winston.emitErrs = true
8 9
9const logDir = path.join(__dirname, '..', '..', config.get('storage.logs')) 10const logDir = path.join(__dirname, '..', '..', config.get('storage.logs'))
11
12// Create the directory if it does not exist
13mkdirp.sync(logDir)
14
10const logger = new winston.Logger({ 15const logger = new winston.Logger({
11 transports: [ 16 transports: [
12 new winston.transports.File({ 17 new winston.transports.File({