-
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
Log format is ignored in uber-jar if there is a custom main method #23400
Comments
Hi there. I suffered the same issue for too long on a Quarkus + Kotlin app , although there was no custom main, nor agent, not anything (and just only a basic hello resource on a minimalist project i played with). It appears there is a kind "explanation" in #2152 The workaround is to add Pascal. |
Similar issue here. I do have a custom main, and deppending on how it is launched logging is different.
I wish that did not show up, perhaps at least reduce the priority of these messages so we can limit console to INFO and get rid of them? |
So from what I can see, you get the problem if you use a static logger in the Main class. That is because the One possibility could be to have something similar to I can have a look at doing that but I would prefer to have @stuartwdouglas and @geoand 's opinion first. |
We actually do set |
Understanding that helped me for our current application. I now do this in my main class:
Instead of just the static creation. |
Let's close this as |
Describe the bug
Console log format is set to
%d{yyyy-MM-dd HH:mm:ss} %-5p [%c] %s%e%n
inapplication.properties
but the log output on the console looks like this:Packaging a fast-jar and running the application does all the pretty-printing:
This seems to happen only if there is a custom main method.
The behavior is the same on Linux, Mac and Windows.
Expected behavior
Log formatting is the same no matter which package type is used.
Actual behavior
Packaging a uber-jar ignories the log formatting whereas fast-jar for example obeys the log formatting configuration.
If there is no custom main method but package types behave the same.
How to Reproduce?
-Dquarkus.package.type=uber-jar
and run the application-Dquarkus.package.type=fast-jar
and run the applicationOutput of
uname -a
orver
Darwin cdh.localdomain 21.2.0 Darwin Kernel Version 21.2.0: Sun Nov 28 20:29:10 PST 2021; root:xnu-8019.61.5~1/RELEASE_ARM64_T8101 arm64
Output of
java -version
java version "17" 2021-09-14 LTS Java(TM) SE Runtime Environment (build 17+35-LTS-2724) Java HotSpot(TM) 64-Bit Server VM (build 17+35-LTS-2724, mixed mode, sharing)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.7.0.Final (also testet with 2.6.3.Final)
Build tool (ie. output of
mvnw --version
orgradlew --version
)maven
Additional information
No response
The text was updated successfully, but these errors were encountered: