Skip to content

Commit

Permalink
Remove logging for health check (#5481)
Browse files Browse the repository at this point in the history
* Update nestjs-pino and related packages and exclude certain paths from logging

This commit updates the nestjs-pino package from version 3.4.0 to 4.0.0 and updates related packages accordingly. Path exclusions in logging have also been introduced, starting with the '/ignore-me-path'. Subsequent changes are made in the config framework to reflect these updates and exclusions.

* Update exclusion path in logging configuration

The current commit modifies the logging configuration exclusion path. It replaces '/ignore-me-path' with '*/health-check'. Now, GET requests to '*/health-check' will be excluded from logging.

* Update dependencies and restructure pnpm-lock.yaml

The dependencies in the pnpm-lock.yaml file were updated, some lines were removed while others were added. The 'overrides' packages and the 'importers' versions, among others, were notably updated. Some new eslint plugins were also added to the codebase.

* Remove pnpm-lock.yaml file

* Add pnpm-lock.yaml file
  • Loading branch information
Cliftonz committed May 15, 2024
1 parent b4de841 commit 0d0b5bc
Show file tree
Hide file tree
Showing 3 changed files with 13,012 additions and 18,479 deletions.
6 changes: 3 additions & 3 deletions packages/application-generic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@
"lodash": "^4.17.15",
"mixpanel": "^0.17.0",
"nestjs-otel": "^5.1.5",
"nestjs-pino": "^3.4.0",
"nestjs-pino": "^4.0.0",
"node-fetch": "^3.2.10",
"pino-http": "^8.3.3",
"pino-pretty": "^9.4.0",
"pino-http": "^9.0.0",
"pino-pretty": "^11.0.0",
"recursive-diff": "^1.0.8",
"redlock": "5.0.0-beta.2",
"reflect-metadata": "^0.1.13",
Expand Down
5 changes: 3 additions & 2 deletions packages/application-generic/src/logging/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NestInterceptor } from '@nestjs/common';
import { NestInterceptor, RequestMethod } from '@nestjs/common';
import {
LoggerErrorInterceptor,
Logger,
Expand Down Expand Up @@ -52,7 +52,7 @@ export function getLogLevel() {
return logLevel;
}

// TODO: should be moved into a config framework
// TODO: ENV should be moved into a config framework
function getLoggingVariables(): ILoggingVariables {
const env = process.env.NODE_ENV ?? 'local';

Expand Down Expand Up @@ -108,6 +108,7 @@ export function createNestLoggingModuleOptions(
);

return {
exclude: [{ path: '*/health-check', method: RequestMethod.GET }],
pinoHttp: {
customLevels: loggingLevelSet,
level: values.level,
Expand Down

0 comments on commit 0d0b5bc

Please sign in to comment.