renatomefi / php-fpm-healthcheck

A POSIX compliant sh script to healthcheck PHP fpm status, can be used only for pinging or check for specific metrics
MIT License
491 stars 55 forks source link

Disable access logs #26

Closed acim closed 2 years ago

acim commented 4 years ago

Is there a way to disable access logs for path /status in php-fpm?

    • 21/Oct/2019:19:58:00 +0000 "GET /status" 200

I run this in Kubernetes and have separate containers for php-fpm and nginx. I don's see the logs from the line above in nginx logs, just in php-fpm logs.

renatomefi commented 4 years ago

Hey @acim, in my experience we see it in both containers, nginx and fpm! It's a bit annoying indeed, I never tried to disable the logs from fpm itself, but if it's possible it should be configurable in the php config! I'll try to take a look!

By the way, if you have split nginx and fpm I'd recommend you to look into: https://github.com/usabilla/php-docker-template

acim commented 4 years ago

I set /health endpoint to nginx and have no logs there, so this is why my nginx is quite. However, php-fpm bloats the access log :smile: Thank you.

I didn't know about this project, but I have already connected nginx and php-fpm by UNIX sock.

johnzzon commented 4 years ago

I'm also interested to know if this is possible. We also only see the log in the php-fpm container.

We use the healthcheck mainly to check startup readiness. While there is startupProbe in Kubernetes, we run on OpenShift where this is not yet available (except as an alpha feature which we are hesitant to enable).

If you find a way to disable logging for the healthcheck please let me know!

wandersonwhcr commented 2 years ago

Hi everyone!

Unfortunately, the output responsible is php-fpm and not our healthcheck.

BTW, there's a thread inside PHP to implement this.

https://bugs.php.net/bug.php?id=80428

I will close this old issue. If you need more help let me know.