Skip to content

Commit

Permalink
Also log user_agent in the response log.
Browse files Browse the repository at this point in the history
  • Loading branch information
terjekv committed Nov 20, 2024
1 parent 44acbf5 commit 22534be
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mreg/middleware/logging_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,12 @@ def log_response(

username = request.user.username

user_agent = self._get_request_header(request, "user-agent", "HTTP_USER_AGENT")

mreg_logger.bind(
user=username,
method=request.method,
user_agent=user_agent,
status_code=status_code,
status_label=status_label,
path=request.path_info,
Expand Down

0 comments on commit 22534be

Please sign in to comment.