Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
RobbinBaauw authored Jun 12, 2019
2 parents 8037ce8 + 8399a9c commit 440cd20
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cshub-server/src/utilities/LoggingMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import logger from "./Logger";

export const logMiddleware = (req: Request, userObj: IJWTToken = null) => {

const userData = userObj !== null ? `, uid: ${userObj.user.id}` : "";
logger.info(`[${req.headers["x-forwarded-for"] || req.connection.remoteAddress}${userData}] - ${req.path}`);
if (req.method !== "OPTIONS") {
const userData = userObj !== null ? `, uid: ${userObj.user.id}` : "";
logger.info(`[${req.headers["x-forwarded-for"] || req.connection.remoteAddress}${userData}] - ${req.path}`);
}

};

0 comments on commit 440cd20

Please sign in to comment.