diff options
author | Chocobozzz <me@florianbigard.com> | 2018-08-31 11:43:46 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-08-31 11:43:46 +0200 |
commit | 328e607d32d7f1e960f8966a70097b030e386ab4 (patch) | |
tree | 348297cadda55d616ece20a39ff1a827ece0c7d8 /server/helpers | |
parent | d6ca951b3cc7cb19ad9f52249444fc68c5d81d50 (diff) | |
download | PeerTube-328e607d32d7f1e960f8966a70097b030e386ab4.tar.gz PeerTube-328e607d32d7f1e960f8966a70097b030e386ab4.tar.zst PeerTube-328e607d32d7f1e960f8966a70097b030e386ab4.zip |
Add sql trace in error log on sequelize error
Diffstat (limited to 'server/helpers')
-rw-r--r-- | server/helpers/logger.ts | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/server/helpers/logger.ts b/server/helpers/logger.ts index ce6e38f15..e1e3a1fe2 100644 --- a/server/helpers/logger.ts +++ b/server/helpers/logger.ts | |||
@@ -22,7 +22,13 @@ function loggerReplacer (key: string, value: any) { | |||
22 | } | 22 | } |
23 | 23 | ||
24 | const consoleLoggerFormat = winston.format.printf(info => { | 24 | const consoleLoggerFormat = winston.format.printf(info => { |
25 | let additionalInfos = JSON.stringify(info.meta || info.err, loggerReplacer, 2) | 25 | const obj = { |
26 | meta: info.meta, | ||
27 | err: info.err, | ||
28 | sql: info.sql | ||
29 | } | ||
30 | |||
31 | let additionalInfos = JSON.stringify(obj, loggerReplacer, 2) | ||
26 | if (additionalInfos === undefined || additionalInfos === '{}') additionalInfos = '' | 32 | if (additionalInfos === undefined || additionalInfos === '{}') additionalInfos = '' |
27 | else additionalInfos = ' ' + additionalInfos | 33 | else additionalInfos = ' ' + additionalInfos |
28 | 34 | ||