Skip to content

Commit

Permalink
Don't queue up log messages when the process isn't running a Quarkus …
Browse files Browse the repository at this point in the history
…application

Fixes: quarkusio#14295
  • Loading branch information
geoand committed Jan 16, 2021
1 parent 93784be commit 50ad980
Showing 1 changed file with 11 additions and 1 deletion.
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,7 +49,15 @@ public Level getLevelOf(final String loggerName) {

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

0 comments on commit 50ad980

Please sign in to comment.