-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Add log level for JVM logs #92382
Add log level for JVM logs #92382
Conversation
With this commit we specify `level` in JVM logs. `level` helps to filter more severe messages from mere debugging messages in logs and with this change we are able to use it also for JVM logs. Here are a few example lines: Before: ``` [2022-12-15T06:19:16.936+0000][15181][gc,start ] GC(0) Pause Young (Normal) (G1 Evacuation Pause) ``` After: ``` [2022-12-15T06:22:27.932+0000][16320][info][gc,start ] GC(0) Pause Young (Normal) (G1 Evacuation Pause) [2022-12-15T06:22:27.932+0000][16320][debug][gc,age ] GC(0) Desired survivor size 14680064 bytes, new threshold 15 (max threshold 15) [2022-12-15T06:22:27.935+0000][16320][info ][gc,phases ] GC(0) Pre Evacuate Collection Set: 0.1ms [2022-12-15T06:22:27.935+0000][16320][trace][gc,age ] GC(0) Age table with threshold 15 (max threshold 15) ``` Notice, that the log level might have trailing spaces. See also https://docs.oracle.com/en/java/javase/19/docs/specs/man/java.html#xlog-tags-and-levels for the available log levels.
Documentation preview: |
Pinging @elastic/es-core-infra (Team:Core/Infra) |
Hi @danielmitterdorfer, I've created a changelog YAML for you. |
Some more notes:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Elasticsearch will add a log level to its JVM logs to allow users to help them detect errors / warnings more easily. With this commit we detect this new field if present and continue to recognize the prior log format without a log level. Relates elastic/elasticsearch#92382 Closes elastic#34054
Thanks for the review! Just fyi: I'm waiting to merge this PR until elastic/beats#34159 is merged so Beats can recognize the new field. |
* Recognize log level in Elasticsearch JVM logs Elasticsearch will add a log level to its JVM logs to allow users to help them detect errors / warnings more easily. With this commit we detect this new field if present and continue to recognize the prior log format without a log level. Relates elastic/elasticsearch#92382 Closes #34054
* Recognize log level in Elasticsearch JVM logs Elasticsearch will add a log level to its JVM logs to allow users to help them detect errors / warnings more easily. With this commit we detect this new field if present and continue to recognize the prior log format without a log level. Relates elastic/elasticsearch#92382 Closes #34054
With this commit we specify
level
in JVM logs.level
helps to filter more severe messages from mere debugging messages in logs and with this change we are able to use it also for JVM logs.Here are a few example lines:
Before:
After:
Notice how the log level might have trailing spaces.
See also
https://docs.oracle.com/en/java/javase/19/docs/specs/man/java.html#xlog-tags-and-levels for the available log levels.