Closed AndreasPetersen closed 2 days ago
/cc @geoand (kotlin)
Can you try:
quarkus.log.category."jakarta.ws.rs.WebApplicationException".level=DEBUG
please?
Thanks for the quick reply @geoand !
I tried setting application.properties
to:
quarkus.log.category."jakarta.ws.rs.WebApplicationException".level=ERROR
but no log appeared. Setting application.properties
to:
quarkus.log.category."jakarta.ws.rs.WebApplicationException".level=ERROR
quarkus.log.level=DEBUG
at least retains the WebApplicationException
at the DEBUG
level:
2024-07-02 14:34:39,950 DEBUG [WebApplicationException] (executor-thread-1) Restarting handler chain for exception exception: jakarta.ws.rs.InternalServerErrorException: This isn't logged
...
2024-07-02 14:34:39,952 DEBUG [WebApplicationException] (executor-thread-1) Application failed the request: jakarta.ws.rs.InternalServerErrorException: This isn't logged
...
Oddly enough it's logged twice.
quarkus.log.category."jakarta.ws.rs.WebApplicationException".level=ERROR
We don't want ERROR
, we want DEBUG
:)
Right, the log levels become increasingly restrictive. You don't choose ERROR
because you want to see errors, for example. Instead, you choose a level based on the verbosity you want:
OFF
- nothing is loggedERROR
- only ERROR
-level messages are loggedWARN
- both ERROR
- and WARN
-level messages are loggedINFO
- ERROR
, WARN
, and INFO
-level messages are loggedDEBUG
- ERROR
, WARN
, INFO
, and DEBUG
-level messages are loggedSo, you can see that if a message (like this error that you want to see) is logged at DEBUG
, then when you set the level to ERROR
, you've turned it off.
I set application.properties
to:
quarkus.log.category."jakarta.ws.rs.WebApplicationException".level=DEBUG
but no log is made
If you attach a sample application, I can have a look and see if there is something we might be missing
Right, the log levels become increasingly restrictive. You don't choose
ERROR
because you want to see errors, for example. Instead, you choose a level based on the verbosity you want:
OFF
- nothing is loggedERROR
- onlyERROR
-level messages are loggedWARN
- bothERROR
- andWARN
-level messages are loggedINFO
-ERROR
,WARN
, andINFO
-level messages are loggedDEBUG
-ERROR
,WARN
,INFO
, andDEBUG
-level messages are logged- etc.
So, you can see that if a message (like this error that you want to see) is logged at
DEBUG
, then when you set the level toERROR
, you've turned it off.
Ah, okay, so setting
quarkus.log.category."WebApplicationException".level=DEBUG
as stated in the documentation does indeed provide the expected result where the error is logged:
2024-07-02 14:43:46,655 DEBUG [WebApplicationException] (executor-thread-1) Restarting handler chain for exception exception: jakarta.ws.rs.InternalServerErrorException: This isn't logged
...
2024-07-02 14:43:46,657 DEBUG [WebApplicationException] (executor-thread-1) Application failed the request: jakarta.ws.rs.InternalServerErrorException: This isn't logged
...
However, the error is logged twice. Should I open a separate issue for that, and close this issue?
If you attach a sample application, I can have a look and see if there is something we might be missing
I provided a link to a reproducer in the bug description, but I'll add it here too :) https://github.com/AndreasPetersen/quarkus-webapplication-log
So quarkus.log.category."WebApplicationException".level=DEBUG
works, but it does indeed log twice. I'll convert the first part to trace, as there is almost no reason to have that information.
Thanks for the help @geoand and @dmlloyd !
Describe the bug
I have a REST server that throws an
InternalServerErrorException
.According to the documentation:
However, when I set it to
ERROR
, no log is made.Expected behavior
That an error log is made
Actual behavior
No log is made
How to Reproduce?
I have provided a reproducer here.
/hello
endpointIf you change
application.properties
to:note that the error is logged at debug level. If you change it to:
then no error is logged.
Output of
uname -a
orver
Linux BD-PF4TWGEK 5.15.153.1-microsoft-standard-WSL2 #1 SMP Fri Mar 29 23:14:13 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Output of
java -version
openjdk version "21.0.3" 2024-04-16 LTS OpenJDK Runtime Environment Temurin-21.0.3+9 (build 21.0.3+9-LTS) OpenJDK 64-Bit Server VM Temurin-21.0.3+9 (build 21.0.3+9-LTS, mixed mode, sharing)
Quarkus version or git rev
3.12.0
Build tool (ie. output of
mvnw --version
orgradlew --version
)------------------------------------------------------------ Gradle 8.8 ------------------------------------------------------------ Build time: 2024-05-31 21:46:56 UTC Revision: 4bd1b3d3fc3f31db5a26eecb416a165b8cc36082 Kotlin: 1.9.22 Groovy: 3.0.21 Ant: Apache Ant(TM) version 1.10.13 compiled on January 4 2023 JVM: 21.0.3 (Eclipse Adoptium 21.0.3+9-LTS) OS: Linux 5.15.153.1-microsoft-standard-WSL2 amd64
Additional information
No response