Skip to content

Commit

Permalink
chore: add LOGGING_LEVEL env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Radulescu committed Dec 12, 2023
1 parent eed460f commit a946554
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
4 changes: 3 additions & 1 deletion backend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,6 @@ AWS_S3_BUCKET_NAME_PUBLIC=

ENCRYPTION_KEY=

ONGHUB_URL=
ONGHUB_URL=

LOGGING_LEVEL=
17 changes: 15 additions & 2 deletions backend/src/common/config/logging.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
export const PinoLoggerConfig = {
import * as dotenv from 'dotenv';
import { Params as PinoLoggerParams, PinoLogger } from 'nestjs-pino';
dotenv.config();

// 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) => {
return req.url.includes('health');
Expand Down

0 comments on commit a946554

Please sign in to comment.