You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@eventmesh.apache.org by "ppkarwasz (via GitHub)" <gi...@apache.org> on 2023/12/31 17:34:00 UTC
[I] [Bug] Maven artifacts should not depend on logging backend (eventmesh)
ppkarwasz opened a new issue, #4700:
URL: https://github.com/apache/eventmesh/issues/4700
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/eventmesh/issues?q=is%3Aissue) 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`](https://mvnrepository.com/artifact/org.apache.eventmesh/eventmesh-common/1.10.0-release). 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`](https://mvnrepository.com/artifact/org.apache.zookeeper/zookeeper/3.9.1) 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.
### How to reproduce
To pinpoint the affected artifacts run:
```sh
./gradlew dependencies
```
and check the `runtimeClasspath` configuration.
### Debug logs
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct) *
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org
Re: [I] [Bug] Maven artifacts should not depend on logging backend (eventmesh)
Posted by "xwm1992 (via GitHub)" <gi...@apache.org>.
xwm1992 closed issue #4700: [Bug] Maven artifacts should not depend on logging backend
URL: https://github.com/apache/eventmesh/issues/4700
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org
Re: [I] [Bug] Maven artifacts should not depend on logging backend (eventmesh)
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #4700:
URL: https://github.com/apache/eventmesh/issues/4700#issuecomment-1873002202
Welcome to the Apache EventMesh community!!
We are glad that you are contributing by opening this issue. :D
Please make sure to include all the relevant context.
We will be here shortly.
If you are interested in contributing to our project, please let us know!
You can check out our contributing guide on [contributing to EventMesh](https://eventmesh.apache.org/community/contribute/contribute).
Want to get closer to the community?
|WeChat Assistant|WeChat Public Account|Slack|
|-|-|-|
|<img src="https://github.com/apache/eventmesh/blob/master/resources/wechat-assistant.jpg?raw=true" width="128"/>|<img src="https://github.com/apache/eventmesh/blob/master/resources/wechat-official.jpg?raw=true" width="128"/>|[Join Slack Chat](https://join.slack.com/t/the-asf/shared_invite/zt-1y375qcox-UW1898e4kZE_pqrNsrBM2g)|
Mailing Lists:
| Name | Description |Subscribe |Unsubscribe|Archive
| ---- | ---- |---- | ---- | ---- |
|Users |User support and questions mailing list| [Subscribe](mailto:users-subscribe@eventmesh.incubator.apache.org) |[Unsubscribe](mailto:users-unsubscribe@eventmesh.incubator.apache.org) |[Mail Archives](https://lists.apache.org/list.html?users@eventmesh.apache.org)|
|Development |Development related discussions| [Subscribe](mailto:dev-subscribe@eventmesh.incubator.apache.org) |[Unsubscribe](mailto:dev-unsubscribe@eventmesh.incubator.apache.org) |[Mail Archives](https://lists.apache.org/list.html?dev@eventmesh.apache.org)|
|Commits |All commits to repositories| [Subscribe](mailto:commits-subscribe@eventmesh.incubator.apache.org) |[Unsubscribe](mailto:commits-unsubscribe@eventmesh.incubator.apache.org) |[Mail Archives](https://lists.apache.org/list.html?commits@eventmesh.apache.org)|
|Issues |Issues or PRs comments and reviews| [Subscribe](mailto:commits-subscribe@eventmesh.incubator.apache.org) |[Unsubscribe](mailto:commits-unsubscribe@eventmesh.incubator.apache.org) |[Mail Archives](https://lists.apache.org/list.html?commits@eventmesh.apache.org)|
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org
Re: [I] [Bug] Maven artifacts should not depend on logging backend (eventmesh)
Posted by "Pil0tXia (via GitHub)" <gi...@apache.org>.
Pil0tXia commented on issue #4700:
URL: https://github.com/apache/eventmesh/issues/4700#issuecomment-1997989505
We recently encountered this issue when developing EventMesh Dashboard:

The EventMesh Dashboard uses Spring Boot's default logback implement, and we have to exclude the implement artifact to avoid `SLF4J: Class path contains multiple SLF4J bindings.` error.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org
Re: [I] [Bug] Maven artifacts should not depend on logging backend (eventmesh)
Posted by "Pil0tXia (via GitHub)" <gi...@apache.org>.
Pil0tXia commented on issue #4700:
URL: https://github.com/apache/eventmesh/issues/4700#issuecomment-1873283478
Thank you for pointing it out! Usually third-party applications will depend on eventmesh-sdk (cf. https://github.com/apache/eventmesh/blob/master/eventmesh-sdks/eventmesh-sdk-java/build.gradle), only `slf4j-api` dependency is transferred from [eventmesh-common](https://github.com/apache/eventmesh/blob/master/eventmesh-common/build.gradle).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org