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

cmd: Add option to disable access log for health endpoints #283

Closed

Conversation

hypnoglow
Copy link
Contributor

Proposed changes

This changeset adds an option to disable access log for health endpoints.
This is especially helpful in environments like Kubernetes, where
special preprocessing filters would be required otherwise.

Checklist

  • I have read the contributing guidelines
  • I have read the security policy
  • I confirm that this pull request does not address a security
    vulnerability. If this pull request addresses a security vulnerability, I
    confirm that I got green light (please contact
    [email protected]) from the maintainers to push
    the changes.
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation within the code base (if appropriate)
  • I have documented my changes in the
    developer guide (if appropriate)

Further comments

The same idea and reasoning as in ory/hydra#1458

This commit adds an option to disable access log for health endpoints.
This is especially helpful in environments like Kubernetes, where
special preprocessing filters would be required otherwise.
@hypnoglow hypnoglow force-pushed the allow-disable-access-log-health branch from 3f3e3da to f838158 Compare October 24, 2019 12:15
@@ -40,7 +40,17 @@ func runProxy(d driver.Driver, n *negroni.Negroni, logger *logrus.Logger) func()
Transport: proxy,
}

n.Use(negronilogrus.NewMiddlewareFromLogger(logger, "oathkeeper-proxy"))
proxyLogger := negronilogrus.NewMiddlewareFromLogger(logger, "oathkeeper-proxy")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are using a small helper for this in other projects:

github.com/ory/x/reqlog.NewMiddlewareFromLogger(logger, "oathkeeper-api").ExcludePaths(healthx.ReadyCheckPath, healthx.AliveCheckPath)

Which basically moves the health checks to "debug" output. It's tested etc so I would prefer using that here :)

aeneasr added a commit that referenced this pull request Dec 17, 2019
Remove health endpoints from the logs to make monitoring easier. Setting `log_level` to `trace` will show these calls.

Closes #283
@aeneasr aeneasr closed this in #314 Dec 17, 2019
aeneasr added a commit that referenced this pull request Dec 17, 2019
Remove health endpoints from the logs to make monitoring easier. Setting `log_level` to `trace` will show these calls.

Closes #283
pike1212 pushed a commit to pike1212/oathkeeper that referenced this pull request Dec 18, 2019
Remove health endpoints from the logs to make monitoring easier. Setting `log_level` to `trace` will show these calls.

Closes ory#283
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

Successfully merging this pull request may close these issues.

2 participants