dunglas / mercure

🪽 An open, easy, fast, reliable and battery-efficient solution for real-time communications
https://mercure.rocks
GNU Affero General Public License v3.0
3.83k stars 278 forks source link

How to set log level in helm chart #915

Open xvilo opened 3 weeks ago

xvilo commented 3 weeks ago

Hi,

The documentation and existing issues are unclear on how to change the log level with the helm chart. I have the hub running in Kubernetes, but my JWT token is not accepted. I set out check the logs, but those are only info. I would like to see more logs but I can not get the right config combination with having tried the following values:

caddyExtraConfig: "
log {
        level WARN
}
"
caddyExtraConfig: "
  level WARN
"
globalOptions: "
  level WARN
"
globalOptions: "
        log {
                level WARN
        }
"
mxmp210 commented 2 weeks ago

The log override can be done via {$CADDY_SERVER_EXTRA_DIRECTIVES} so equivalent to that in helm chart would be caddy-extra-directives key mapped at Caddy Env

Try setting extra directives which would set proper logger for your server directive :

caddyExtraDirectives: "
        log {
                level WARN
        }
"

However I'd recommend building your own Custom Caddyfile Config and add sections necessary compared to overriding the ones in default Caddyfile, the default chart doesn't have config to replace bootstrap code to get started quickly, but you can maintain your own as per requirements.