Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added trivial test for every basic variant of execution #18

Merged
merged 4 commits into from
Oct 4, 2024

Conversation

dmatej
Copy link
Contributor

@dmatej dmatej commented Oct 3, 2024

No description provided.

@dmatej dmatej changed the title Added trivial test for every besic variant of execution Added trivial test for every basic variant of execution Oct 3, 2024
@dmatej dmatej requested a review from avpinchuk October 4, 2024 09:29
@dmatej dmatej merged commit 3a7977b into eclipse-ee4j:main Oct 4, 2024
2 checks passed
@dmatej dmatej deleted the tests branch October 4, 2024 10:35
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>

This comment was marked as resolved.

Copy link
Contributor Author

@dmatej dmatej Oct 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not, take a look to SLF4J website. It is the artifact name just to keep continuity. JUL was added to JDK at the time of Java 1.4, since then it has nearly the same api, but internally it changed over time. And it is also a default backend behind System Logger facade, which came in Java 11.

SLF4J can bind to both as an api or as an implementation. With all those platforms you basically have to choose your backend and sink all other to it. SLF4J is very capable in this discipline, so it this case:

  • TestContainers use slf4j-api
  • GlassFish uses JUL as the impl backend extended by own logmanager.
  • GlassFish and its dependencies use JUL, System. Logger and JBoss-Logging + some additonal custom apis as an api facade.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see, this is the JUL implementation binding; I have avoided using JUL and was not familiar with that artifact. Your explanation makes sense. In the context of most elements of the stack using it, it makes sense to make it the target. I've avoided it due to it being the only implementation with a performance penalty for bridging away from it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The penalty is only when an app logs using JUL and you want to translate that to slf4j and then log with something else, e.g. log4j. It’s the opposite case here. In this case, test containers use slf4j for logging and we want that to be logged via JUL, in the same way as our logs in tests. This doesn’t incur much performance penalty because JUL is called only when log messages are really logged and not always, as in the first case. Note that the slf4j-jdk14 artfact means slf4j logged via JUL, while jul-to-slf4j means JUL logged via slf4j and subsequently via some slf4j adapter (log4j, logback, etc)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants