diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-01-30 17:05:22 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-01-30 17:05:22 +0100 |
commit | cda021079ff455cc0fd0eb95a5395fa808ab63d1 (patch) | |
tree | 056716de7460462b74b861051a5e9da6e2633fce /src/logger.js | |
parent | 86435b9baedfe300a28ea4545511c1b50d4119f6 (diff) | |
download | PeerTube-cda021079ff455cc0fd0eb95a5395fa808ab63d1.tar.gz PeerTube-cda021079ff455cc0fd0eb95a5395fa808ab63d1.tar.zst PeerTube-cda021079ff455cc0fd0eb95a5395fa808ab63d1.zip |
New directory organization
Diffstat (limited to 'src/logger.js')
-rw-r--r-- | src/logger.js | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/src/logger.js b/src/logger.js deleted file mode 100644 index 850af10cb..000000000 --- a/src/logger.js +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | ;(function () { | ||
2 | // Thanks http://tostring.it/2014/06/23/advanced-logging-with-nodejs/ | ||
3 | 'use strict' | ||
4 | |||
5 | var config = require('config') | ||
6 | var winston = require('winston') | ||
7 | |||
8 | var logDir = __dirname + '/../' + config.get('storage.logs') | ||
9 | |||
10 | winston.emitErrs = true | ||
11 | |||
12 | var logger = new winston.Logger({ | ||
13 | transports: [ | ||
14 | new winston.transports.File({ | ||
15 | level: 'debug', | ||
16 | filename: logDir + '/all-logs.log', | ||
17 | handleExceptions: true, | ||
18 | json: true, | ||
19 | maxsize: 5242880, | ||
20 | maxFiles: 5, | ||
21 | colorize: false | ||
22 | }), | ||
23 | new winston.transports.Console({ | ||
24 | level: 'debug', | ||
25 | handleExceptions: true, | ||
26 | humanReadableUnhandledException: true, | ||
27 | json: false, | ||
28 | colorize: true | ||
29 | }) | ||
30 | ], | ||
31 | exitOnError: true | ||
32 | }) | ||
33 | |||
34 | module.exports = logger | ||
35 | module.exports.stream = { | ||
36 | write: function (message, encoding) { | ||
37 | logger.info(message) | ||
38 | } | ||
39 | } | ||
40 | })() | ||