Skip to content

Commit

Permalink
Merge pull request #45613 from geoand/vertx-logging
Browse files Browse the repository at this point in the history
Use VertxLogDelegateFactory for internal Vert.x logging
  • Loading branch information
geoand authored Jan 16, 2025
2 parents efe5f24 + cf6c2cd commit ad0a86b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,12 @@ IOThreadDetectorBuildItem ioThreadDetector(VertxCoreRecorder recorder) {
return new IOThreadDetectorBuildItem(recorder.detector());
}

@BuildStep
@Record(ExecutionTime.RUNTIME_INIT)
void configureLogging(VertxCoreRecorder recorder) {
recorder.configureQuarkusLoggerFactory();
}

@BuildStep
@Produce(ServiceStartBuildItem.class)
@Record(value = ExecutionTime.RUNTIME_INIT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
@Recorder
public class VertxCoreRecorder {

private static final String LOGGER_FACTORY_NAME_SYS_PROP = "vertx.logger-delegate-factory-class-name";

static {
System.setProperty("vertx.disableTCCL", "true");
}
Expand Down Expand Up @@ -666,6 +668,13 @@ public static Supplier<Vertx> recoverFailedStart(VertxConfiguration config, Thre

}

public void configureQuarkusLoggerFactory() {
String loggerClassName = System.getProperty(LOGGER_FACTORY_NAME_SYS_PROP);
if (loggerClassName == null) {
System.setProperty(LOGGER_FACTORY_NAME_SYS_PROP, VertxLogDelegateFactory.class.getName());
}
}

static class VertxSupplier implements Supplier<Vertx> {
final LaunchMode launchMode;
final VertxConfiguration config;
Expand Down

0 comments on commit ad0a86b

Please sign in to comment.