X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=scripts%2Fparse-log.ts;h=e2c42bf4c6ca3c8ec60afb4ec054966ad7c070e1;hb=3daf400219fe8cc94025886ba14876bc59a45244;hp=81a22f7a0d3ba9b60d19e4c3ea50e322b72d157d;hpb=41dbdb8acff3ac56187e8149eab0ff82e2377597;p=github%2FChocobozzz%2FPeerTube.git diff --git a/scripts/parse-log.ts b/scripts/parse-log.ts index 81a22f7a0..e2c42bf4c 100755 --- a/scripts/parse-log.ts +++ b/scripts/parse-log.ts @@ -2,7 +2,6 @@ import { createReadStream } from 'fs' import { join } from 'path' import { createInterface } from 'readline' import * as winston from 'winston' -import { readFileBufferPromise } from '../server/helpers/core-utils' import { CONFIG } from '../server/initializers/constants' const label = CONFIG.WEBSERVER.HOSTNAME + ':' + CONFIG.WEBSERVER.PORT @@ -16,7 +15,8 @@ const logger = new winston.Logger({ humanReadableUnhandledException: true, json: false, colorize: true, - prettyPrint: true + prettyPrint: true, + stderrLevels: [] }) ], exitOnError: true @@ -38,5 +38,11 @@ const rl = createInterface({ rl.on('line', line => { const log = JSON.parse(line) - logLevels[log.level](log.message) + const additionalInfo: any = {} + + Object.keys(log).forEach(logKey => { + if (logKey !== 'message' && logKey !== 'level') additionalInfo[logKey] = log[logKey] + }) + + logLevels[log.level](log.message, additionalInfo) })