Prevent /up healthchecks from appearing in access logs #409
jaydrogers
started this conversation in
Ideas & Feature Requests
Replies: 1 comment
-
Server Side Up provides a way to add custom startup scripts, so I created my own to ignore Laravel's
Contents of #!/command/with-contenv sh
if [ "$SUPPRESS_LARAVEL_UP_LOGS" = "true" ]; then
echo "ℹ️ Suppressing Laravel's /up access logs."
echo '' >> /etc/apache2/vhost-templates/https.conf
echo '# Suppress Laravel /up endpoint logs' >> /etc/apache2/vhost-templates/https.conf
echo 'SetEnvIf Request_URI "^/up$" dontlog' >> /etc/apache2/vhost-templates/https.conf
echo '' >> /etc/apache2/vhost-templates/http.conf
echo '# Suppress Laravel /up endpoint logs' >> /etc/apache2/vhost-templates/http.conf
echo 'SetEnvIf Request_URI "^/up$" dontlog' >> /etc/apache2/vhost-templates/http.conf
else
echo "ℹ️ Suppressing Laravel's /up access logs is not enabled, enable it by setting SUPPRESS_LARAVEL_UP_LOGS=true."
fi Nice and clean logs now. Happy coding 🙏 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
👉 Describe the problem
/up
health check, the access logs get noisy with every check./healthcheck
supports ignores sending requests to the access log👥 Problem evidence & reach
https://x.com/angusmcritchie/status/1818550305363230764
🏆 Proposed Solution
There are two options I see as of now
"Synchronize" The
HEALTHCHECK_PATH
variableHEALTHCHECK_PATH
could set all the server configs for NGINX, Apache, Unit, etcAdd a second block to ignore
/up
as wellIf the above solution becomes to complicated to support, then it is possible to just ignore
/up
. The only problem is that makes a pretty big assumption that no one will use the/up
endpoint in their application.🥰 Describe the "impact" on users?
This will reduce noisy logs on production machines for people using the Laravel healthcheck endpoint.
💯 How do we validate the problem is solved?
/up
do not appear in logsBeta Was this translation helpful? Give feedback.
All reactions