Skip to content

Commit

Permalink
chore: add LOGGING_LEVEL for logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Radulescu committed Dec 12, 2023
1 parent 85fa6fb commit d439672
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions backend/src/infrastructure/config/logging.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
import { Request } from 'express';
import * as dotenv from 'dotenv';
import { Params as PinoLoggerParams } from 'nestjs-pino';
dotenv.config();

export const PinoLoggerConfig = {
// Possible loggin levels, from quiet to verbose
export type LOGGING_LEVEL =
| 'fatal'
| 'error'
| 'warn'
| 'info'
| 'debug'
| 'trace';

export const PinoLoggerConfig: PinoLoggerParams = {
pinoHttp: {
level: 'trace',
level: process.env.LOGGING_LEVEL || 'trace',
autoLogging: {
ignore: (req: Request): boolean => {
return req.url.includes('health');
Expand Down

0 comments on commit d439672

Please sign in to comment.