-
Notifications
You must be signed in to change notification settings - Fork 3
/
logger.config.ts
35 lines (31 loc) · 1.11 KB
/
logger.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import type { LoggerConfig } from './src/types';
export const defaultLoggerConfig: LoggerConfig = {
// Filter by module name
moduleFilter: [],
// Filter by log prefix, e.g. adding
// `pref` to filter is going to correspond to showing `[PREF] ` logs
prefixFilter: [],
// Lowest printed log level of default logger
logLevel: 'info',
// Log levels of prisma logger that are enabled
dbLogLevel: ['info'],
// Lowest printed log level of express logger
httpLogLevel: 'info'
};
export const debugLogConfig: LoggerConfig = {
// Filter by module name
moduleFilter: ['RWA Internal Listener'],
// Filter by log prefix, e.g. adding
// `pref` to filter is going to correspond to showing `[PERF]` logs
prefixFilter: [],
// Lowest printed log level of default logger
logLevel: 'debug',
// Log levels of prisma logger that are enabled
dbLogLevel: ['query'],
// Lowest printed log level of express logger
httpLogLevel: 'debug'
};
function getLoggerConfig(debug: boolean): LoggerConfig {
return debug ? debugLogConfig : defaultLoggerConfig;
}
export const loggerConfig = getLoggerConfig(!!process.env.DEBUG);