Elasticsearch: Two ways to define root logger level - should we choose one?

Created on 24 Mar 2016  路  6Comments  路  Source: elastic/elasticsearch

Currently the logger level of the root logger can be defined in two ways:

  1. set logger.level:DEBUG
  2. set logger._root: DEBUG

The 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.

:CorInfrLogging >enhancement CorInfra help wanted

Most helpful comment

+1 to having only one way

All 6 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

clintongormley picture clintongormley  路  3Comments

martijnvg picture martijnvg  路  3Comments

rpalsaxena picture rpalsaxena  路  3Comments

brwe picture brwe  路  3Comments

DhairyashilBhosale picture DhairyashilBhosale  路  3Comments