Skip to content

fix: Remove TempLoggerWrapper and use slf4j-jdk14 as the logging implementation.#157

Closed
sunyuhan1998 wants to merge 3 commits intoa2aproject:mainfrom
sunyuhan1998:fix-issue-94-plan-jul
Closed

fix: Remove TempLoggerWrapper and use slf4j-jdk14 as the logging implementation.#157
sunyuhan1998 wants to merge 3 commits intoa2aproject:mainfrom
sunyuhan1998:fix-issue-94-plan-jul

Conversation

@sunyuhan1998
Copy link
Contributor

@sunyuhan1998 sunyuhan1998 commented Jul 4, 2025

Hi @kabir , as we discussed previously: #94. This PR removes the TempLoggerWrapper and uses slf4j-jdk14 (which routes SLF4J log output to java.util.logging) as the default logging implementation.

Due to the limitations of java.util.logging, in order to use it, you must specify the JVM argument: -Djava.util.logging.config.file=src/test/resources/logging.properties before running each test class.

To be honest, I don't really recommend this approach, because it's just too cumbersome.

I would recommend the approach shown in: #158 instead.

Fixes #94


Update: Thanks to Gemini's suggestion! This configuration item is now automatically specified through the maven-surefire-plugin.

…ault logging implementation. To enable proper log output, you need to specify the following JVM parameter before running:

          `-Djava.util.logging.config.file=src/test/resources/logging.properties`

Signed-off-by: Sun Yuhan <sunyuhan1998@users.noreply.github.com>
Signed-off-by: Sun Yuhan <sunyuhan1998@users.noreply.github.com>
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @sunyuhan1998, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses issue #94 by removing the TempLoggerWrapper and switching to slf4j-jdk14 as the logging implementation. This change requires a specific JVM argument to be set for tests to function correctly, which the author acknowledges may be cumbersome.

Highlights

  • Logging Implementation: Replaces the custom TempLoggerWrapper with slf4j-jdk14 for logging, routing SLF4J output to java.util.logging.
  • Dependency Management: Adds slf4j-jdk14 dependency to pom.xml and sdk-server-common/pom.xml.
  • Quarkus Arc Exclusions: Adds exclusions for jboss-logging, jboss-logmanager, jboss-threads, and slf4j-jboss-logmanager when using quarkus-arc in sdk-server-common/pom.xml.
  • Configuration Requirement: Specifies the need for the JVM argument -Djava.util.logging.config.file=src/test/resources/logging.properties for tests due to java.util.logging limitations.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request successfully removes the custom TempLoggerWrapper and integrates slf4j-jdk14 as the logging implementation, which is a positive step towards using standard logging practices. The changes in the pom.xml files correctly manage the dependencies and exclusions necessary for this transition, especially within a Quarkus environment. The addition of logging.properties for java.util.logging configuration is also appropriate. My primary feedback addresses the author's concern regarding the cumbersomeness of specifying the JVM argument for tests, suggesting a maven-surefire-plugin configuration to automate this process and enhance developer experience.

…tion.

Signed-off-by: Sun Yuhan <sunyuhan1998@users.noreply.github.com>
@sunyuhan1998
Copy link
Contributor Author

To be honest, as mentioned in the issue #140, I don't know why the unit test failed either — it works fine locally.

@kabir
Copy link
Collaborator

kabir commented Jul 4, 2025

@sunyuhan1998 the failure is a known issue #140

@sunyuhan1998
Copy link
Contributor Author

@sunyuhan1998 the failure is a known issue #140

Okay, that does seem a bit strange. I tried running the unit test class that caused the failure locally, but it ran fine multiple times on my machine.

@kabir
Copy link
Collaborator

kabir commented Jul 4, 2025

Yeah, I've not had time to figure it out. It is very strange

@kabir
Copy link
Collaborator

kabir commented Jul 4, 2025

Thank you. Since this is more getting output for tests, I think we can go with your simpler approach in #158. So I will close this one :-)

@kabir kabir closed this Jul 4, 2025
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.

Remove TempLoggerWrapper and configure debug/trace logging for tests

2 participants