aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/logger.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers/logger.ts')
-rw-r--r--server/helpers/logger.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/server/helpers/logger.ts b/server/helpers/logger.ts
index f1808849e..0548dfd5b 100644
--- a/server/helpers/logger.ts
+++ b/server/helpers/logger.ts
@@ -40,14 +40,17 @@ function getLoggerReplacer () {
40} 40}
41 41
42const consoleLoggerFormat = winston.format.printf(info => { 42const consoleLoggerFormat = winston.format.printf(info => {
43 const obj = omit(info, 'label', 'timestamp', 'level', 'message', 'sql') 43 const toOmit = [ 'label', 'timestamp', 'level', 'message' ]
44 if (CONFIG.LOG.PRETTIFY_SQL) toOmit.push('sql')
45
46 const obj = omit(info, ...toOmit)
44 47
45 let additionalInfos = JSON.stringify(obj, getLoggerReplacer(), 2) 48 let additionalInfos = JSON.stringify(obj, getLoggerReplacer(), 2)
46 49
47 if (additionalInfos === undefined || additionalInfos === '{}') additionalInfos = '' 50 if (additionalInfos === undefined || additionalInfos === '{}') additionalInfos = ''
48 else additionalInfos = ' ' + additionalInfos 51 else additionalInfos = ' ' + additionalInfos
49 52
50 if (info.sql) { 53 if (CONFIG.LOG.PRETTIFY_SQL && info.sql) {
51 additionalInfos += '\n' + sqlFormat(info.sql, { 54 additionalInfos += '\n' + sqlFormat(info.sql, {
52 language: 'sql', 55 language: 'sql',
53 ident: ' ' 56 ident: ' '