Skip to content

Is there an easy way to turn off logs for healthcheck paths? #220

Discussion options

You must be logged in to vote

This is how I turned off logging for health check requests. (in my app, the health checks were hitting the URL /heathcheck/

map $request_uri $loggable {
  /healthcheck/ 0;
  default 1;
}

server {
...
  access_log  /var/log/nginx/access.log  main if=$loggable;
...
}

source: http://nginx.org/en/docs/http/ngx_http_log_module.html

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by tiangolo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #106 on August 29, 2024 00:54.