Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to change the log level #494

Closed
JoergSommer opened this issue Apr 7, 2021 · 8 comments
Closed

How to change the log level #494

JoergSommer opened this issue Apr 7, 2021 · 8 comments
Labels
wontfix This will not be worked on

Comments

@JoergSommer
Copy link

Hello!

I try to change the log level of the mercure server (I'm using docker dunglas/mercure:v0.11.1). Can not find any solutions:

  • debug and demo from mercure itself seem to be false by default
  • caddy log directive set to:
    log {
    level WARN
    }

Howevery, all log msg are still displayed. Debug and Info too.

What can I do?

Best regards
Sommer

@JoergSommer
Copy link
Author

Updating to v0.11.2 does not help

@JoergSommer
Copy link
Author

JoergSommer commented Apr 7, 2021

Problem seems to be uber.zap. NewProduction is by default INFO, NewDevelopment is by default DEBUG. You should use BasicConfiguration, I guess.

https://pkg.go.dev/go.uber.org/zap#hdr-Choosing_a_Logger

Plus a new configuration parameter like log_level linked to the BasicConfiguration of uber.zap

@divine
Copy link
Contributor

divine commented Apr 14, 2021

Hello,

Related #384 #384

Basically, the reason is that currently, Caddy doesn't support defining global error level - the configuration file needs to be modified manually.

The good news is that the new version of Caddy which is in a beta already has it: caddyserver/caddy#4028

Thanks!

@divine
Copy link
Contributor

divine commented May 11, 2021

Caddy's new version (2.4.0) was released, you can now define the global default logging option:

{
    # Debug
    {$DEBUG}
    # HTTP/3 support
    servers {
        protocol {
            experimental_http3
        }
    }
    log {
       level WARN
    }
}

This issue might be closed now.

Thanks!

@stale
Copy link

stale bot commented Jul 10, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Jul 10, 2021
@stale stale bot closed this as completed Jul 17, 2021
@si14
Copy link

si14 commented Jul 29, 2021

@dunglas the latest Mercure release (0.12.0) is still based on pre-2.4.0 Caddy. Do you think it might be updated at some point?

@dunglas
Copy link
Owner

dunglas commented Jul 29, 2021

Yes it will when I'll tag a new version. In the meantime you can build from sources using xcaddy if needed.

@melroy89
Copy link

melroy89 commented Jun 24, 2023

Is the log level still in the global section?? Since it doesn't seem like it..

Please document this better on your official docs site.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

5 participants