Currently the logger level of the root logger can be defined in two ways:
logger.level:DEBUGlogger._root: DEBUGThe first works from command line -Des.logger.level=DEBUG. It does not work with dynamic update settings like
PUT /_cluster/settings
{
"transient" : {
"logger.level" : "INFO"
}
}
The latter works with dynamic update settings like
PUT /_cluster/settings
{
"transient" : {
"logger._root" : "INFO"
}
}
and in test annotation for regular tests @TestLogging("_root:DEBUG"). It does not work when passing in cmd line when we start a node with -Des.logger._root=DEBUG. Consequently test annotations for bwc tests also have no effect for old version nods because here we pass the es.logger._root as cmd line arg.
As a funny side effect, when we use logging annotation @TestLogging("level:DEBUG") then the old version nodes will log in DEBUG and the new version nodes not and the other way round if we set @TestLogging("_root:DEBUG")
I am unsure what to do with this. If we want to allow both options we have to fix that somewhere here before we call settingsBuilder.replacePropertyPlaceholders() https://github.com/elastic/elasticsearch/blob/2.x/core/src/main/java/org/elasticsearch/common/logging/log4j/LogConfigurator.java#L109 I think.
But it would be better to have only one way to set the logger level which would then be a bigger operation.
Checked only version 2.3
+1 to having only one way
Ok, I vote for _root but do not have a strong opinion. Let me know if you agree so we can proceed.
Given that the way to set the logger level for (eg) cluster logs is:
PUT _cluster/settings
{
"transient": {
"logger.cluster": "INFO"
}
}
not logger.cluster.level, I agree with using logger._root
And making logger.level an exception
This is still an issue and we might want to work on it at some point.
Most helpful comment
+1 to having only one way