X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=scripts%2Fparse-log.ts;h=e2c42bf4c6ca3c8ec60afb4ec054966ad7c070e1;hb=a2431b7dcbc72c05101dcdbe631ff84a823aeb51;hp=8aac6fbda704f0a60ad43024f2aad79d235834b5;hpb=47e0652b4a98916d4a1d012fbec61afd73a30565;p=github%2FChocobozzz%2FPeerTube.git diff --git a/scripts/parse-log.ts b/scripts/parse-log.ts index 8aac6fbda..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, log.stack) + const additionalInfo: any = {} + + Object.keys(log).forEach(logKey => { + if (logKey !== 'message' && logKey !== 'level') additionalInfo[logKey] = log[logKey] + }) + + logLevels[log.level](log.message, additionalInfo) })