Skip to content

Commit

Permalink
Merge pull request #5244 from flexion/10309-opex-event-emitters
Browse files Browse the repository at this point in the history
10309 Opex: Fix MaxListenersExceededWarning
  • Loading branch information
jimlerza committed Aug 15, 2024
2 parents db7b3bb + 6d04a06 commit 43cc135
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions web-api/src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ const console = () =>
handleRejections: true,
}));

export const logger =
(transport = console()) =>
(req, res, next) => {
const createdLogger = createLogger({ transports: [transport] });

export const logger = (transport = console()) => {
const createdLogger = createLogger({ transports: [transport] });
return (req, res, next) => {
if (process.env.NODE_ENV === 'production') {
const requestBody = cloneDeep(req.body);

Expand Down Expand Up @@ -66,6 +64,7 @@ export const logger =

return next();
};
};

function redactPasswordFields(obj) {
const passwordRegex = /password/i;
Expand Down

0 comments on commit 43cc135

Please sign in to comment.