Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SLFJ4 bridge for the Maven logger

I'm writing a Maven 3.x plugin and want to log with SLF4J & Logback.

I found some SLF4J bindings for the Maven Logger:

  • http://www.jcabi.com/jcabi-maven-slf4j/index.html
  • https://bitbucket.org/peachjean/slf4j-mojo

However, these seem to be SLF4J bindings but I believe what I need is a bridge for the Maven Logger i.e. to bridge/route all Maven log statements to SLF4J and use LogBack binding with logback.xml config.

like image 893
DarVar Avatar asked Dec 11 '25 06:12

DarVar


1 Answers

You can use SLF4J directly from Maven plugin since Maven 3.1:

The standard Maven distribution, from Maven 3.1.0 onward, uses the SLF4J API for logging combined with the SLF4J Simple implementation. Future versions may use a more advanced implementation, but we chose to start simple.

No bridges, bindings, etc. needed.

Source: https://maven.apache.org/maven-logging.html

like image 81
sm4rk0 Avatar answered Dec 14 '25 03:12

sm4rk0



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!