I want to add a customized Appender to Log4J 2.x. However there is no clear API to use it.

Right now I am using:

((org.apache.logging.log4j.core.Logger)LogManager.getRootLogger()).addAppender(new MyAppender());

This is working, however the API states this:

This method is not exposed through the public API and is used primarily for unit testing.

There are a couple of examples in the net where it might be added different, but no on is referring to an "official" way.

What is the preferred way of adding such an Appender?

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