-
Notifications
You must be signed in to change notification settings - Fork 197
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
Structured logging (JSON) #464
Comments
@levkk do we need to keep using the env_logger? This is a good use case for the tracing-subscriber. Like the examples below, we could display logs using the existing formatters. Both Let me know your thoughts so I can send the PR.
|
this commit adds the tracing-subscriber crate and use its formatters to support multiple log formats. More details in postgresml#464 (comment) Signed-off-by: Sebastian Webber <[email protected]>
this commit adds the tracing-subscriber crate and use its formatters to support multiple log formats. More details in postgresml#464 (comment) Signed-off-by: Sebastian Webber <[email protected]>
initial PR is here: #517 |
this commit adds the tracing-subscriber crate and use its formatters to support multiple log formats. More details in postgresml#464 (comment) Signed-off-by: Sebastian Webber <[email protected]>
this commit adds the tracing-subscriber crate and use its formatters to support multiple log formats. More details in #464 (comment) Signed-off-by: Sebastian Webber <[email protected]>
This is pretty awesome, although I'm quite a bit annoyed because of it as well. Fun story, this change as it rolled out broke my production infra! So. Associated here is the warning-level message in pgcat when it's discarding a session to the pool due to "SET" being called, along with a few other things that are "warning" level logs which happen... a lot. So. If it's fex. a PHP based backend, which always calls "SET" to make sure fex. the output for BYTEA format in postgres is canonical, and theres.. say, a few million calls to those functions every few minutes, we get a lot of log lines. Almost all identical, for a behaviour we don't really care much about. ( Discard is cheaper than a tcp+tls connection, I'm cool with that.) But, here the log filtering from RUST_LOG variable changed, so the discard filters to ignore such lines are now logged. And well, that ate my log quota. And that's the story of why logging is bad you should all go back to spooling logs to an unbuffered line printer instead. ( ps. how the bleep do I filter out specific spammy warning-level messages now? ) |
Tell me about it ..I go through my Sentry quota in two days and just sit there wondering if I should give them more money or just run my own error reporting tool. |
Is your feature request related to a problem? Please describe.
Its pretty common these days to emit structured logs instead of textual logs. Its easier to parse and some cloud environments already has support for parsing and indexing them. My problem is mainly with GKE, textual logs to stderr/stdout are by default logged with severity of ERROR which is not really great as that brings a lot of noise.
Describe the solution you'd like
Ability to switch to json logging, a severity field would decide the level of the logged message. Example logged message:
https://cloud.google.com/logging/docs/structured-logging
The text was updated successfully, but these errors were encountered: