You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had searched in the issues and found no similar issues.
Environment
Other
EventMesh version
master
What happened
Multiple EventMesh artifacts have a runtime dependency on log4j-core (a Log4j API implementation) and log4j-slf4j-impl (an SLF4J implementation), for example eventmesh-common. These can cause problems to applications that depend on EventMesh artifacts, but use a different logging backend.
Unlike logging APIs (e.g. slf4j-api, log4j-api, commons-logging, etc.) that can coexist within the same application, logging backends and bridges (e.g. logback-classic, log4j-core, log4j-to-slf4j, log4j-slf4j-impl, etc.) are mutually exclusive. A couple of examples:
if an application has as runtime dependencies logback-classic and log4j-slf4j-impl (both are implementation of SLF4J) only one of them will work,
if an application has as runtime dependencies log4j-to-slf4j (a bridge from Log4j API to SLF4J) and log4j-slf4j-impl (a bridge from SLF4J to Log4j API), both of them will cease to work to prevent an infinite loop.
It is easy to find such examples in practice: an application based both on zookeper and EventMesh, will have both logback-classic and log4j-core on its classpath.
To prevent this kind of conflicts, the following steps should be necessary:
all the logging backends and bridges (an incomplete list: logback-classic, log4j-core, log4j-to-slf4j, log4j-slf4j-impl, log4j-to-jul, log4j-jul, log4j-over-slf4j) should be removed from the runtimeClasspath and moved to the testRuntimeOnly configuration,
all log4j2.xml configuration files should be removed from the published JARs, so that they not interfere with the configuration provided by applications,
the log4j-core, log4j-slf4j-impl and log4j-jul artifacts should be added to the TAR distribution, since it is meant to run as a standalone application.
Search before asking
Environment
Other
EventMesh version
master
What happened
Multiple EventMesh artifacts have a runtime dependency on
log4j-core(a Log4j API implementation) andlog4j-slf4j-impl(an SLF4J implementation), for exampleeventmesh-common. These can cause problems to applications that depend on EventMesh artifacts, but use a different logging backend.Unlike logging APIs (e.g.
slf4j-api,log4j-api,commons-logging, etc.) that can coexist within the same application, logging backends and bridges (e.g.logback-classic,log4j-core,log4j-to-slf4j,log4j-slf4j-impl, etc.) are mutually exclusive. A couple of examples:logback-classicandlog4j-slf4j-impl(both are implementation of SLF4J) only one of them will work,log4j-to-slf4j(a bridge from Log4j API to SLF4J) andlog4j-slf4j-impl(a bridge from SLF4J to Log4j API), both of them will cease to work to prevent an infinite loop.It is easy to find such examples in practice: an application based both on
zookeperand EventMesh, will have bothlogback-classicandlog4j-coreon its classpath.To prevent this kind of conflicts, the following steps should be necessary:
logback-classic,log4j-core,log4j-to-slf4j,log4j-slf4j-impl,log4j-to-jul,log4j-jul,log4j-over-slf4j) should be removed from theruntimeClasspathand moved to thetestRuntimeOnlyconfiguration,log4j2.xmlconfiguration files should be removed from the published JARs, so that they not interfere with the configuration provided by applications,log4j-core,log4j-slf4j-implandlog4j-julartifacts should be added to the TAR distribution, since it is meant to run as a standalone application.How to reproduce
To pinpoint the affected artifacts run:
and check the
runtimeClasspathconfiguration.Debug logs
No response
Are you willing to submit PR?
Code of Conduct