projects
/
oweals
/
peertube.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2eb5a04
)
Ensure the log directory is created before instanciate the logger
author
Chocobozzz
<florian.bigard@gmail.com>
Sun, 1 May 2016 07:58:34 +0000
(09:58 +0200)
committer
Chocobozzz
<florian.bigard@gmail.com>
Sun, 1 May 2016 07:58:34 +0000
(09:58 +0200)
server/helpers/logger.js
patch
|
blob
|
history
diff --git
a/server/helpers/logger.js
b/server/helpers/logger.js
index d3fce4cc96909e32fe18c95c2a6bcc05ceca312e..4ff61380b12740becc1345d46bfd689911c98e16 100644
(file)
--- a/
server/helpers/logger.js
+++ b/
server/helpers/logger.js
@@
-2,11
+2,16
@@
'use strict'
const config = require('config')
+const mkdirp = require('mkdirp')
const path = require('path')
const winston = require('winston')
winston.emitErrs = true
const logDir = path.join(__dirname, '..', '..', config.get('storage.logs'))
+
+// Create the directory if it does not exist
+mkdirp.sync(logDir)
+
const logger = new winston.Logger({
transports: [
new winston.transports.File({