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

enableAccessLog filter actively disable routes that are not matched #1514

Open
rgritti opened this issue Aug 26, 2020 · 5 comments
Open

enableAccessLog filter actively disable routes that are not matched #1514

rgritti opened this issue Aug 26, 2020 · 5 comments

Comments

@rgritti
Copy link

rgritti commented Aug 26, 2020

Describe the bug
Filter enableAccessLog with parameter, disables access logs of status codes that are not matched.

To Reproduce

  1. set skipper.Options.AccessLogDisabled = false
  2. add a route with -> enableAccessLog(4, 5)
  3. make a requests that returns 2xx

Expected behavior
I expect to see the access logs

Observed behavior
Access logs for the request are not shown

@AlexanderYastrebov
Copy link
Member

enableAccessLog overrides global Skipper AccessLogDisabled setting per route

@rgritti
Copy link
Author

rgritti commented Sep 1, 2020

Right, but in my example above I have never explicitly disabled anything, but I end up with access logs for status codes 2xx disabled.

@szuecs
Copy link
Member

szuecs commented Sep 1, 2020

@rgritti as far as I understand you set the default to log, but then you filter logging for the route to log only 4xx and 5xx.
So the behavior seems as you configured, not?

@rgritti
Copy link
Author

rgritti commented Sep 22, 2020

@szuecs I think that if you enable the access logs globally, and then you enable specifically the 4xx and 5xx, you should see the 2xx as well, no?

but then you filter logging for the route to log only 4xx and 5xx

The only that you wrote is not clear from the filter name nor from the documentation.
I would at least expect that the documentation to say that enableAccessLog() disable the logs for everything that is not matched

@szuecs
Copy link
Member

szuecs commented Sep 22, 2020

No, I think you should specify what you want to see, no inheritance!
We should make the docs more clear, thanks for the feedback. Do you want to create a PR for changing the docs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants