[ 
https://issues.apache.org/jira/browse/LOG4J2-3394?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17487650#comment-17487650
 ] 

Duo Zhang commented on LOG4J2-3394:
-----------------------------------

{quote}
This looks wrong

rootLogger = ${sys:hbase.root.logger:-INFO,console}

It should be:

rootLogger = ${sys:hbase.root.logger:-INFO},console
{quote}

Thanks [~ggregory] for chimming in. As [~rgoers] said above, the syntax is 
correct. Why I started the discussion thread on the dev list is because in 
hadoop and hbase we will use HADOOP_ROOT_LOGGER and HBASE_ROOT_LOGGER to config 
level and appenders at once, so the default value should be 'INFO,console'.

{quote}
The code Matt added simply takes the values it finds and replaces the specified 
property with the two "normal" properties that PropertiesConfiguration expects. 
It simply isn't interpolating the value before processing it. It should be 
relatively simple to do that. At this point it would be using the default 
Interpolator.
{quote}
The above comment from [~ckozak] said this is an anti pattern in log4j, maybe 
the problem here is that, it is easy to add the interpolating but maybe the 
properties have not been fully initialized yet? I'm not very familiar with the 
architecture, if simply adding interpolating can work then this is the easiest 
way to solve the problem.

If not, maybe we could go back to the CompoundProperty solution. The 
CompoundProperty could use regex and each property under it can be a group of 
the regex matching result.

And on configuration appenders, maybe we need to add appenderRefs which accept 
multiple appenders with a comma separated list. Although this is not a good 
practise for xml and yaml, but if we can only lookup variables when entering 
the format free configuration handling, this is the only possible solution to 
support adding multiple appenders at once?

Thanks.

> The 'rootLogger=${sys:root.logger:-INFO,console}' does not work
> ---------------------------------------------------------------
>
>                 Key: LOG4J2-3394
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-3394
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Configuration
>            Reporter: Duo Zhang
>            Priority: Major
>         Attachments: log4j2.err, log4j2.properties
>
>
> Tried the new feature introduced in LOG4J2-3341 in hbase.
> https://github.com/apache/hbase/pull/4096
> I built a tarball and try to start a standalone hbase instance locally, but 
> log4j2 failed to load the system properties of rootLogger.
> Will upload the config and error output.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to