-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
Change default Java Util Logging format #96519
Conversation
Pinging @elastic/es-core-infra (Team:Core/Infra) |
@elasticmachine run elasticsearch-ci/bwc |
I think that this is good. A few comments:
|
I can still see the message
on main (with your commit) when I remove the two filters you added I still cannot see the warning with VectorUtilProvider
and a cluster is running with JDK20 |
While this may improve the situation with JUL messages, it still has the confusion of emitting all JUL as WARN because it is coming from stderr. I think we should focus on #94613 which will allow the log level to be translated, and then the format will not matter because the messages will be bridged to log4j. I experimented with the bridge before and can resume my work. WDYT? |
closing as #96683 is merged |
Currently Elasticsearch is not setting a JUL configuration, so JUL is defaulting a format to
https://github.com/AdoptOpenJDK/openjdk-jdk9u/blob/master/jdk/src/java.base/share/classes/jdk/internal/logger/SimpleConsoleLogger.java#L404
this means it contains a New Line in the middle. That results in log messages being split and interleaved.
This is also preventing the filtering messages with MMapDirectory in LogConfigurator to work correctly
This commit sets a simple default format
[level][loggerName] message exceptionIfAny\n
Example of current behaviour:
log.info("Using MemorySegmentIndexInput with Java 19; to disable start with -Dorg.apache.lucene.store.MMapDirectory.enableMemorySegments=false");
will result in (when filtering removed):
and with filtering we end up with just single line:
with this change we will get the message fully filtered out or in single line (when filtering disabled):