You can set the system property in your main() method as the first line
which would do the trick.

As for a way to register itself later, I suppose that would be a feature
request: https://issues.apache.org/jira/browse/LOG4J2

On 1 May 2017 at 19:55, Clément Guillaume <cguilla...@hotpads.com> wrote:

> Hi,
>
> I wonder if it would be possible to programmatically configure jul to route
> to log4j2.
> It would be useful in case where system properties can not be used to set
> the LogManager or the log4j-jul jar cannot be in the classpath at
> bootstrap.
>
> jul to log4j2 bridge allow a similar configuration:
> https://www.slf4j.org/api/org/slf4j/bridge/SLF4JBridgeHandler.html
>



-- 
Matt Sicker <boa...@gmail.com>

Reply via email to