Skip to content

Commit

Permalink
Ignore /logger requests in middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
kmcginnes committed Aug 29, 2024
1 parent ab27ff2 commit 5ad9730
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/graph-explorer-proxy-server/src/logging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ export function logRequestAndResponse(req: Request, res: Response) {
/** Creates the pino-http middleware with the given logger and appropriate options. */
export function requestLoggingMiddleware() {
return (req: Request, res: Response, next: NextFunction) => {
// Ignore requests to logger endpoint
if (req.path.includes("/logger")) {
next();
return;
}

// Wait for the request to complete.
req.on("end", () => {
logRequestAndResponse(req, res);
Expand Down

0 comments on commit 5ad9730

Please sign in to comment.