Hi Ralph,

On Thu, 7 Apr 2022 at 07:50, Ralph Goers <ralph.go...@dslextreme.com> wrote:
> Second, putting the property in log4j2.component.properties is correct. 
> However, it must only be on the classpath of the web app that needs it, not 
> in a shared directory.

If there is no `log4j-api` in the web app classpath, I would refrain
from adding a `log4j2.component.properties` to that application.

Currently most components use a single `PropertiesUtil` instance, that
is created when `log4j-api` is first initialized. If multiple
applications are using the same `log4j-api` the
`log4j.component.properties` files contained in all but the first
application will be ignored.

That is why I would propose to remove thread context classloader
support from `PropertiesUtil` in future 2.x releases or check all the
call sites of `PropertiesUtil.getProperties()` to see if they need
application specific properties or not. Of course in 3.x your
properties enhancement proposal solves most problems.

Piotr

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

Reply via email to