Closed starksm64 closed 1 week ago
/cc @radcortez (config)
So the problem is the inclusion of this line from the logging config guide:
quarkus.log.handlers=console,file
This is not seen as attaching the default console and file handlers to the root category, rather these are new handlers that need a new configuration. The document refers to quarkus.log.handlers
in 3 places:
// Ex 1
Example 1. An example of a global configuration that applies to all categories:
quarkus.log.handlers=console,mylog
// Ex2
Although the root logger’s handlers are usually configured directly via quarkus.log.console, quarkus.log.file and quarkus.log.syslog, it can nonetheless have additional named handlers attached to it using the quarkus.log.handlers property.
// Ex3
# configure a named file handler that sends the output to 'quarkus.log'
quarkus.log.handler.file.CONSOLE_MIRROR.enable=true
quarkus.log.handler.file.CONSOLE_MIRROR.path=quarkus.log
# attach the handler to the root logger
quarkus.log.handlers=CONSOLE_MIRROR
Only Ex3 is consistent with the current behavior. Ex1 will cause the error message indicated in this issue for the console handler unless one adds a confusing configuration entry like:
quarkus.log.handler.console.console.enable=true
and then it is another ConsoleHandler instance, not the default one.
cc @dmlloyd @jamezp
I'm not too sure how useful I'd be here TBH. I don't really know much about how Quarkus does logging. At some point I could have a look, but it's going to a bit because I've got some other things that need to get done first and I'd have to learn about logging in Quarkus.
David is also on PTO so I'm not too sure who else knows about logging in Quarkus. This issue seems specific to Quarkus and not the log manager.
Thanks @jamezp.
I'll have to take a look at this (hopefully soon)
I agree that
// Ex 1
Example 1. An example of a global configuration that applies to all categories:
is missleading as it assumes that the user has already configured "named handlers" like so:
quarkus.log.handler.console.console.enable=true
quarkus.log.handler.file.mylog.enable=true
Yes the doc is clearly incorrect here and should be fixed.
Describe the bug
Why is this error generated on a simple logging usecase? Even after reading the https://quarkus.io/guides/logging#console-log-handler section and named handlers section I have no idea what the error is, or what category the console handler is linked to that is the problem. I would assume it is the default root category, in which case this should be handled.
I am using the simplified io.quarkus.logging.Log interface in the app.
Expected behavior
Either there should be no error, or a suggestion on what to fix is in the error message, or the https://quarkus.io/guides/logging#console-log-handler should cover this error.
Actual behavior
An error with no explanation
How to Reproduce?
Output of
uname -a
orver
Darwin Scotts-Mac-Studio.local 21.6.0 Darwin Kernel Version 21.6.0: Wed Apr 24 06:05:14 PDT 2024; root:xnu-8020.240.18.708.4~1/RELEASE_ARM64_T6000 arm6
Output of
java -version
openjdk version "21.0.1" 2023-10-17 LTS OpenJDK Runtime Environment Temurin-21.0.1+12 (build 21.0.1+12-LTS) OpenJDK 64-Bit Server VM Temurin-21.0.1+12 (build 21.0.1+12-LTS, mixed mode
Quarkus version or git rev
3.12.2
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.9.6 (bc0240f3c744dd6b6ec2920b3cd08dcc295161ae) Maven home: /Users/starksm/bin/apache-maven-3.9.6 Java version: 21.0.1, vendor: Eclipse Adoptium, runtime: /Library/Java/JavaVirtualMachines/temurin-21.jdk/Contents/Home Default locale: en_US, platform encoding: UTF-8 OS name: "mac os x", version: "12.7.5", arch: "aarch64", family: "mac"
Additional information
No response