Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
myrotvorets-team authored and renovate[bot] committed Oct 23, 2023
1 parent 6cf0121 commit ca991ae
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/container.mts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ function createEnvironment(): ReturnType<typeof environment> {
function createLogger({ req }: RequestContainer): Logger {
const logger = getLogger();
logger.clearAttributes();
logger.setAttribute('ip', req.ip);
if (req.ip) {
logger.setAttribute('ip', req.ip);
}

logger.setAttribute('request', `${req.method} ${req.url}`);
return logger;
}
Expand Down

0 comments on commit ca991ae

Please sign in to comment.