quilkin icon indicating copy to clipboard operation
quilkin copied to clipboard

Be able to configure tracing/log levels

Open markmandel opened this issue 3 years ago • 2 comments

Is your feature request related to a problem? Please describe.

With the original use of slog debugger the logging level was tied to the build level - debug logging on the debug build, and info logging on release.

See: https://googleforgames.github.io/quilkin/main/book/using.html

As far as I can tell, it seems there is no current control mechanisms for log levels with Quilkin, since tracing_subscriber doesn't have configuration by env var or similar.

https://github.com/googleforgames/quilkin/blob/37423cd93cb90c49aa2f88c7bd8e7ae270865902/src/main.rs#L76

Describe the solution you'd like

My initial thought is to include a logging (tracing? observability? something?) section in the config yaml that allows configuration of tracing levels, and probably also output format, as outlined in #531 (since tracing levels control not just logging, but also overall tracing in the system).

An EnvFilter would likely also be useful to incorporate to be able to provide fine grained control over logging levels throughout the system, and be able to enable more verbose debugging at one specific parts of the system.

Describe alternatives you've considered

We could use something like env_logger or use a command line argument, but I think it would be best to keep as much of the configuration as possible in a single place, in the yaml file.

Additional context

This work should also include review of if we need both a debug and release build and image of Quilkin anymore, as the original purpose is no longer required.

markmandel avatar Jun 07 '22 23:06 markmandel

I have this partially already implemented in the xds PR, I'll pull it out as a separate PR.

XAMPPRocky avatar Jun 08 '22 03:06 XAMPPRocky

Since that's now merged, we can see how we're doing it currently, which is that we use by default we set it to info, and that you can override it with the RUST_LOG environment variable (which is standard across all Rust related projects). We could also read from the configuration or command line arguments here if desired.

https://github.com/googleforgames/quilkin/blob/2f7b2cb3b660c2185101888d4b3f20cfa0469305/src/main.rs#L102-L108

XAMPPRocky avatar Aug 10 '22 09:08 XAMPPRocky

I think we can close this as we now support the standard log configuration variable (RUST_LOG).

XAMPPRocky avatar Sep 19 '22 09:09 XAMPPRocky

Let's leave this open until we get the updated documentation (tagged as an item for 0.4.0). Not feature complete until it's been documented 😄

markmandel avatar Sep 20 '22 23:09 markmandel