How to disable caddy server LOGS?

1. Output of caddy version:

v2.6.2 h1:wKoFIxpmOJLGl3QXoo6PNbYvGW4xLEgo32GPBEjWL8o=

2. How I run Caddy:

service caddy start

a. System environment:

Ubuntu 22.04.1 LTS (VPS) no docker.

d. My complete Caddy config: {

        route {
          mercure {
                transport_url local://local
                publisher_jwt !oooops!
                subscriber_jwt !noideastahha!
        publish_origins *
                cors_origins https://domainnamehere
                subscriptions {$MERCURE_EXTRA_DIRECTIVES}
                write_timeout 0s
          respond /healthz 200
          respond "Not Found" 404

3. The problem Iā€™m having:

Attaching SYSLOG, plenty of logs,

5. What I already tried:

I did try, LOG warn and LOG error, nothing helping at all. Even skip Log

Maybe you could ask the Mercure project to log those at DEBUG level instead of INFO level, it might be more appropriate ā€“ but that would be their decision to make.

That said, you can use the log global option to customize logging:

You can exclude by logger name, so you could exclude http.handlers.mercure from the default logger to make it shut up. But that would stop all the mercure logs, including errors, which is probably not your intent.

Or you could exclude mercure from the default logger, and make a second logger which does include mercure but only at WARNING level and above, so INFO and below are excluded.

1 Like

This topic was automatically closed after 30 days. New replies are no longer allowed.