diff options
Diffstat (limited to 'server/helpers/logger.js')
-rw-r--r-- | server/helpers/logger.js | 5 |
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 | ||
4 | const config = require('config') | 4 | const config = require('config') |
5 | const mkdirp = require('mkdirp') | ||
5 | const path = require('path') | 6 | const path = require('path') |
6 | const winston = require('winston') | 7 | const winston = require('winston') |
7 | winston.emitErrs = true | 8 | winston.emitErrs = true |
8 | 9 | ||
9 | const logDir = path.join(__dirname, '..', '..', config.get('storage.logs')) | 10 | const logDir = path.join(__dirname, '..', '..', config.get('storage.logs')) |
11 | |||
12 | // Create the directory if it does not exist | ||
13 | mkdirp.sync(logDir) | ||
14 | |||
10 | const logger = new winston.Logger({ | 15 | const logger = new winston.Logger({ |
11 | transports: [ | 16 | transports: [ |
12 | new winston.transports.File({ | 17 | new winston.transports.File({ |