NPE when running the container with 'disableESLogger()' config
Opened this issue · 2 comments
cristibozga commented
Hello.
I'm using the following config:
ElasticsearchClusterRunner.Configs configs = ElasticsearchClusterRunner.newConfigs()
.clusterName("es-test")
.numOfNode(1)
.disableESLogger()
.printOnFailure();
but when I start the runner I get a NPE:
Caused by: java.lang.NullPointerException: Cannot invoke "org.elasticsearch.logging.internal.spi.LoggerFactory.getLogger(java.lang.Class)" because the return value of "org.elasticsearch.logging.internal.spi.LoggerFactory.provider()" is null
at org.elasticsearch.logging.LogManager.getLogger(LogManager.java:35)
at org.elasticsearch.plugins.scanners.ExtensibleFileReader.<clinit>(ExtensibleFileReader.java:24)
I see that in the class ElsticsearchClusterRunner al the line 465 we skip the config of the logger, so LoggerFactory.provider() will return null.
I use Elasictsearch 8.7.1 and elasticsearch-cluster-runner 8.7.1.0
Thanks in advance
marevol commented
Do you use log4j 2.19.0?
Elasticsearch depends on it.
cristibozga commented
yes, I use exactly that version of log4j.
but as I explained in my comment LoggerFactory.provider() will return null as the init of the logger is skipped