Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make http headers appear in decision logs regardless of log level #6951

Closed
alvarogomez93 opened this issue Aug 22, 2024 · 0 comments · Fixed by #6955
Closed

Make http headers appear in decision logs regardless of log level #6951

alvarogomez93 opened this issue Aug 22, 2024 · 0 comments · Fixed by #6955

Comments

@alvarogomez93
Copy link
Contributor

alvarogomez93 commented Aug 22, 2024

What is the underlying problem you're trying to solve?

in #6750, OPA added the capability of setting http headers inside decision logs. Unfortunately they're tied to the info log level, if you run an error log level they won't appear in the decision logs.

https://github.com/open-policy-agent/opa/blob/main/runtime/logging.go#L67-L72

Describe the ideal solution

Decouple the http header visualization from the log level so they can always appear in the decision logs regardless of the log level so it can be used in production environments where error log level is usually set by default

ashutosh-narkar added a commit to ashutosh-narkar/opa that referenced this issue Aug 22, 2024
Previously the HTTP request context was included in the
request context at the info access log level. This means
if the access log level was set to error for instance,
the context would not include the http request context and
hence it would not be surfaced via decision logs.

This change always add the http request context to the request
context so that HTTP info like headers will be surfaced via decision
logs irrespective of the access log level.

Fixes: open-policy-agent#6951

Signed-off-by: Ashutosh Narkar <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant