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

[proxy] Produce access logs only for non-200 requests #4740

Closed
csweichel opened this issue Jul 8, 2021 · 4 comments · Fixed by #4864
Closed

[proxy] Produce access logs only for non-200 requests #4740

csweichel opened this issue Jul 8, 2021 · 4 comments · Fixed by #4864
Assignees
Labels
component: proxy groundwork: awaiting deployment operations: past incident This issue arose during a past incident or its post-mortem

Comments

@csweichel
Copy link
Contributor

Thereby cleaning up the proxy logs and making them more useful.

@csweichel csweichel added operations: past incident This issue arose during a past incident or its post-mortem component: proxy labels Jul 8, 2021
@csweichel
Copy link
Contributor Author

I'm not convinced that Caddy can do this out of the box. I found nothing in the docs our sources that would indicate conditional logging.

@leodido
Copy link
Contributor

leodido commented Jul 8, 2021

Probably there's a "tricky" way to do it with Caddy (need to double-check on its version, tho).

Setting the level version of the log config to warn would avoid 200s being logged.

https://caddyserver.com/docs/caddyfile/directives/log


I'm defining this "tricky" because it's more a side effect than an ability to effectively select what to log and what to do not log.

leodido added a commit that referenced this issue Jul 8, 2021
… requests

The rationale is that by changing the `level` key of the `log` directive (default INFO).
The `warn` value should be enough to achieve the task in #4740

Ref.: https://caddyserver.com/docs/caddyfile/directives/log

Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
@aledbf
Copy link
Member

aledbf commented Jul 8, 2021

I think we should not use the default logger and instead write a small plugin like this one and just set the fields we need.
Basically, trim this file and define a new directive, like gitpod.log

@leodido
Copy link
Contributor

leodido commented Jul 8, 2021

think we should not use the default logger and instead write a small plugin like this one and just set the fields we need.
Basically, trim this file and define a new directive, like gitpod.log

This ^^^ would be the correct way to go. I agree.

Just to clarify: I defined my attempt as a trick for this exact reason :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: proxy groundwork: awaiting deployment operations: past incident This issue arose during a past incident or its post-mortem
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants