How in JAVA to override LOG.debug() and my own LOG.debug() extending Log4j2

Viewed 15

I am looking for best approach: I have a lot of classes in the projects. I used Log4j2 (with Lombok) almost in each class. The old approach is without MarkerL LOG.debug( "some {}", ()->something() )

we would like to replace all these LOG.debug() with a new one some thing like this :

public void debug( args[]... ) {
    LOG.debug( getGlobalMarker(), args[] .... ); 
}

using lombok @CustomLog helps with it, but my question is how is correct to implement (extending) Log4j2 ?

0 Answers
Related