You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Benjamin Asbach <co...@impl.it> on 2020/04/29 11:39:27 UTC

Should `Configurator.reconfigure` reconfigure existing `Loggers`?

Hej.

I currently try to reconfigure log4j2 by using 
`Configurator.reconfigure`: 
https://gist.github.com/asbachb/6cac46a191ea47792bcf467cd865f06f

I'd expect that there's a console output like:
```
INFO1
INFO2
DEBUG2
```

but instead I just get:
```
INFO1
```

It seems that `Configurator.reconfigure does not reconfigure existing 
logger instances. I wonder if this behaviour is expected?

Thanks
Benjamin

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Should `Configurator.reconfigure` reconfigure existing `Loggers`?

Posted by Benjamin Asbach <co...@impl.it>.
So basically I recognized that `PropertiesConfigurationBuilder` is 
clearing the passed `Properties`.

So when recreating the second properties my test case is working.


On 2020-04-29 13:39, Benjamin Asbach wrote:
> Hej.
> 
> I currently try to reconfigure log4j2 by using
> `Configurator.reconfigure`:
> https://gist.github.com/asbachb/6cac46a191ea47792bcf467cd865f06f
> 
> I'd expect that there's a console output like:
> ```
> INFO1
> INFO2
> DEBUG2
> ```
> 
> but instead I just get:
> ```
> INFO1
> ```
> 
> It seems that `Configurator.reconfigure does not reconfigure existing
> logger instances. I wonder if this behaviour is expected?
> 
> Thanks
> Benjamin
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org