-
Notifications
You must be signed in to change notification settings - Fork 94
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
Set log level #153
Comments
So this is interesting, because I assumed this was controlled by Rust compilation settings more than anything else. I.e. a release build of Quilkin does not output debug logging (I actually assumed the debug statements don't even get included in the binary). |
So coming back around to this:
Thoughts? |
Thanks for clarifying the test loggger scenario! The issue with compiling away log levels is mainly that at runtime we can't e.g temporarily enable them. From the slog docs, only trace level is compiled away by default both for debug/release binaries which sounds fine to rely on while debug->error is toggle-able at runtime, we can log at a hardcoded default level INFO and later use slog_atomic? |
To copy paste (source):
It looks like debug logging is removed in the release binaries, but not in debug builds - which makes sense. So actually in release builds won't be able to have debug build output anyway, unless we explicitly allow it (which I don't think we should really do - but we should have debug builds available) |
Ah I see, I misread the other one as trace for both. I don't see a reason to disable debug for release atm, since then there's no alternative to e.g temporarily fetch detailed log info at runtime. We can not compile debug level away? |
By default, we compile away debug for the So reverting what I said previously - let's not have log level be switchable at runtime. I would advocate you either run the I'm not sure, but I have a feeling we are in furious agreement here? 😄 |
The use cases I had in mind re switching at runtime were scenarios where something is wrong in production and you want logging of what's going on, that won't be possible currently since those log lines don't exist. I guess if that's actually a thing that someone needs down the line we can have it switchable at runtime and until then we can use the default behavior of compiling debug away for release. |
Yeah, I think that makes sense - let's see what usage patterns should be. Do we have agreement that we should ship both prod and debug builds though? |
Ah I was thinking release vs debug builds means when a user or dev compiles it themself. But rather multiple official builds of the same version for example, yeah that could be nice to have |
Ooh, can this also be closed now, since we have both release and debug builds? |
Yes we can! closing... |
Currently we do not explicitly set a log level and as a result we log debug messages to stdout today.
Ideally we would want to make the log level configurable via an endpoint on the admin server but for this ticket we can hard code the log level to INFO to avoid the proxy producing chatty logs.
We currently create the base logger in two places today - one for the actual proxy and the other one for tests.
Not sure what the difference is atm but if possible we can remove the one used in tests and have only one function for creating logger.
Also, the logger creating functions are currently done in an unrelated files (proxy/builder.rs)
src/logger.rs
and move the logger creating functions over to itHard code any created logger to log at level INFOIf feasible, remove the function entirely for creating loggers in tests, and reuse one function across the code baseThe text was updated successfully, but these errors were encountered: