diff options
Diffstat (limited to 'helpers/logger.js')
-rw-r--r-- | helpers/logger.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/helpers/logger.js b/helpers/logger.js index 850af10cb..fa5b53708 100644 --- a/helpers/logger.js +++ b/helpers/logger.js | |||
@@ -4,11 +4,9 @@ | |||
4 | 4 | ||
5 | var config = require('config') | 5 | var config = require('config') |
6 | var winston = require('winston') | 6 | var winston = require('winston') |
7 | |||
8 | var logDir = __dirname + '/../' + config.get('storage.logs') | ||
9 | |||
10 | winston.emitErrs = true | 7 | winston.emitErrs = true |
11 | 8 | ||
9 | var logDir = __dirname + '/../' + config.get('storage.logs') | ||
12 | var logger = new winston.Logger({ | 10 | var logger = new winston.Logger({ |
13 | transports: [ | 11 | transports: [ |
14 | new winston.transports.File({ | 12 | new winston.transports.File({ |
@@ -31,10 +29,13 @@ | |||
31 | exitOnError: true | 29 | exitOnError: true |
32 | }) | 30 | }) |
33 | 31 | ||
34 | module.exports = logger | 32 | logger.stream = { |
35 | module.exports.stream = { | ||
36 | write: function (message, encoding) { | 33 | write: function (message, encoding) { |
37 | logger.info(message) | 34 | logger.info(message) |
38 | } | 35 | } |
39 | } | 36 | } |
37 | |||
38 | // --------------------------------------------------------------------------- | ||
39 | |||
40 | module.exports = logger | ||
40 | })() | 41 | })() |