-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Allow override of "level" key's name in json log #12946
Comments
There's already extension allowing override for "level" and much more other configurable options for json logging. |
afaik, name or key overriding is now possible, see quarkus-logging-json config For example, our ECS logging setup in Quarkus apps is: quarkus:
log:
console:
json:
key-overrides: "timestamp=@timestamp,level=log.level,logger-name=log.logger,thread-name=process.thread.name,thread-id=process.thread.id,process-name=process.name,process-id=process.pid,stack-trace=error.stack_trace"
excluded-keys: ["loggerClassName", "sequence", "hostName", "mdc", "ndc"]
additional-field:
service.name:
value: "my-service-name"
type: "string" |
@dratasich great, thank you very much! |
Hey,
For the key overrides I get Is there something I'm doing wrong?
Quarkus version is 2.16.1. Any help would be appreciated, thank you ! |
As pointed out in #36133, the config format/syntax changed for the string arrays:
Thanks @ozangunalp and @GinaGeorgescul :) |
Description
Problem: For Google Cloud Logging, every json entry is stored with "default" logging level no matter what level is used by an application. Reason is: the whole body of json entry is stored in Google Cloud Logging as a 2nd-level entry under "jsonPayload" key. This makes logs filtering a bit harder and makes harder or impossible to use GCP Error reporting
However, Google allows to set logging level by specifying "severity" key in log entry's json. Here's related stackoverflow question.
Enhancement: Allow to override default "level" name of log level field.
This is at least useful for Google Cloud Logging, where "severity" field in json is automatically recognized and moved to "top level" of logging entry.
Implementation ideas
Extension name: logging-json
I have at least 2 options in mind:
I'll create a PR for option 1 very soon
The text was updated successfully, but these errors were encountered: