ncasaux / camel-plantuml

camel-plantuml allows to generate PlantUML diagrams from deployed Camel routes
MIT License
37 stars 6 forks source link

log4j-slf4j-impl cannot be present with log4j-to-slf4j #11

Closed mklueh closed 2 years ago

mklueh commented 2 years ago

Hello,

I'm running into this problem. It already existed in hawtio as well https://github.com/hawtio/hawtio/issues/2755

SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Exception in thread "main" java.lang.ExceptionInInitializerError
Caused by: org.apache.logging.log4j.LoggingException: log4j-slf4j-impl cannot be present with log4j-to-slf4j
    at org.apache.logging.slf4j.Log4jLoggerFactory.validateContext(Log4jLoggerFactory.java:60)
    at org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(Log4jLoggerFactory.java:44)
    at org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(Log4jLoggerFactory.java:33)
    at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:53)
    at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:33)
    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:363)
    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:388)
    at com.mainfirst.pmx.client.Application.<clinit>(Application.java:16)

FAILURE: Build failed with an exception.

Would it be possible to make it working with logback?

ncasaux commented 2 years ago

Hello,

What would be the steps to reproduce this ?

mklueh commented 2 years ago

Hello,

What would be the steps to reproduce this ?

I'm using Spring Boot without further logging libraries. It uses logback by default.

https://www.baeldung.com/spring-boot-logging#1-default-logback-logging

My guess is there is no transitive dependency involved that is responsible for this problem.

ncasaux commented 2 years ago

I just tried with a Spring Boot app which embeds camel-plantuml 1.4.0, and it works as expected. I don't have those error. I tried with latest Spring Boot version (2.7.3). Which version do you use ?