mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-03 01:39:37 +02:00
Ensure the log directory is created before instanciate the logger
This commit is contained in:
parent
2eb5a041b3
commit
320d627544
1 changed files with 5 additions and 0 deletions
|
@ -2,11 +2,16 @@
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
const config = require('config')
|
const config = require('config')
|
||||||
|
const mkdirp = require('mkdirp')
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
const winston = require('winston')
|
const winston = require('winston')
|
||||||
winston.emitErrs = true
|
winston.emitErrs = true
|
||||||
|
|
||||||
const logDir = path.join(__dirname, '..', '..', config.get('storage.logs'))
|
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({
|
const logger = new winston.Logger({
|
||||||
transports: [
|
transports: [
|
||||||
new winston.transports.File({
|
new winston.transports.File({
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue