-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Request logging does not work in @QuarkuTests #26138
Comments
https://stage.code.quarkus.io/ is down at the moment (showing "Failed to load Quarkus config" but still serving a status code of 200). I came across this issue while trying the rest-client-reactive-quickstart, too. Maybe your issue is caused by that. |
https://stage.code.quarkus.io/ is available again. |
@albers Thanks for you reply, but that was not the case because I got the replies when debugging and because when running the application as jar, the logs were printed. |
/cc @Sgitario, @cescoffier, @geoand |
This has to do with how logging is (not) configured in generated Gradle projects. In Maven projects we make sure that JBoss Logmanager is used (by setting a system property for surefire and failsafe), but in Gradle projects we don't do this. By adding: test {
systemProperty "java.util.logging.manager", "org.jboss.logmanager.LogManager"
} logging works correctly. |
Not sure; it seems reasonable to me. |
That's what we do in sample test projects and what recommanded in the doc. I can add it to the gradle code start as well, I don't know why it's not the case yet |
Okay thanks. Let's add it then as logging in tests is pretty broken without it. |
Describe the bug
This reproducer shows the issue: there I used a template from code.quarkus.com and the resteasy reactive client tutorial and tried to log the traffic as described in the documentation.
If I run
./gradlew quarkusDev
and manually open my browser inlocalhost:8080/hello
, then I can see the request logs. The problem is that this does not happen in tests: if I run a test using@QuarkusTest
, the logs are not shown.(The same applied to CLI applications).
Expected behavior
Logs should be shown both in tests and in "production" environments.
Actual behavior
Log configuration is ignored in tests.
How to Reproduce?
Reproducer: https://github.com/oscarfh/quarkus-request-log-issue
./gradlew quarkusDev
https://stage.code.quarkus.io/api
Output of
uname -a
orver
Linux laptoip 5.11.0-41-generic #45~20.04.1-Ubuntu SMP Wed Nov 10 10:20:10 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Output of
java -version
openjdk version "17.0.3" 2022-04-19 OpenJDK Runtime Environment (build 17.0.3+7-Ubuntu-0ubuntu0.20.04.1) OpenJDK 64-Bit Server VM (build 17.0.3+7-Ubuntu-0ubuntu0.20.04.1, mixed mode, sharing)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
No response
Build tool (ie. output of
mvnw --version
orgradlew --version
)2.9.2.Final
Additional information
No response
The text was updated successfully, but these errors were encountered: