Skip to content
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

Don't queue up log messages when the process isn't running a Quarkus application #14316

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ public final class InitialConfigurator implements EmbeddedConfigurator {

public static final DelayedHandler DELAYED_HANDLER;

private volatile Boolean isQuarkusApplication = null;

static {
//a hack around class loading
//this is always loaded in the root class loader with jboss-logmanager,
Expand Down Expand Up @@ -47,14 +49,24 @@ public Level getLevelOf(final String loggerName) {

@Override
public Handler[] getHandlersOf(final String loggerName) {
if (isQuarkusApplication == null) {
try {
Class.forName("io.quarkus.runner.ApplicationImpl", false, InitialConfigurator.class.getClassLoader());
isQuarkusApplication = true;
} catch (ClassNotFoundException e) {
isQuarkusApplication = false;
}
}
if (loggerName.isEmpty()) {
if (ImageInfo.inImageBuildtimeCode()) {
// we can't set a cleanup filter without the build items ready
return new Handler[] {
createDefaultHandler()
};
} else {
} else if (isQuarkusApplication) {
return new Handler[] { DELAYED_HANDLER };
} else {
return EmbeddedConfigurator.NO_HANDLERS;
}
} else {
return EmbeddedConfigurator.NO_HANDLERS;
Expand Down