Skip to content

Commit

Permalink
Add access log handler to the main router if non-app root-path is dif…
Browse files Browse the repository at this point in the history
…ferent from root-path
  • Loading branch information
xstefank committed Aug 10, 2022
1 parent 0025aff commit 767eeda
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,9 @@ ServiceStartBuildItem finalizeRouter(
recorder.finalizeRouter(beanContainer.getValue(),
defaultRoute.map(DefaultRouteBuildItem::getRoute).orElse(null),
listOfFilters, vertx.getVertx(), lrc, mainRouter, httpRouteRouter.getHttpRouter(),
httpRouteRouter.getMutinyRouter(),
httpRouteRouter.getMutinyRouter(), httpRouteRouter.getFrameworkRouter(),
nonApplicationRootPathBuildItem.isDedicatedRouterRequired(),
nonApplicationRootPathBuildItem.isAttachedToMainRouter(),
httpRootPathBuildItem.getRootPath(),
launchMode.getLaunchMode(),
!requireBodyHandlerBuildItems.isEmpty(), bodyHandler, gracefulShutdownFilter,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,8 @@ public void finalizeRouter(BeanContainer container, Consumer<Route> defaultRoute
List<Filter> filterList, Supplier<Vertx> vertx,
LiveReloadConfig liveReloadConfig, Optional<RuntimeValue<Router>> mainRouterRuntimeValue,
RuntimeValue<Router> httpRouterRuntimeValue, RuntimeValue<io.vertx.mutiny.ext.web.Router> mutinyRouter,
RuntimeValue<Router> frameworkRouter,
boolean nonApplicationDedicatedRouter, boolean nonApplicationAttachedToMainRouter,
String rootPath, LaunchMode launchMode, boolean requireBodyHandler,
Handler<RoutingContext> bodyHandler,
GracefulShutdownFilter gracefulShutdownFilter, ShutdownConfig shutdownConfig,
Expand Down Expand Up @@ -552,7 +554,11 @@ public void handle(HttpServerRequest event) {
}
AccessLogHandler handler = new AccessLogHandler(receiver, accessLog.pattern, getClass().getClassLoader(),
accessLog.excludePattern);
if (nonApplicationDedicatedRouter && !nonApplicationAttachedToMainRouter) {
frameworkRouter.getValue().route().order(Integer.MIN_VALUE).handler(handler);
}
httpRouteRouter.route().order(Integer.MIN_VALUE).handler(handler);

quarkusWrapperNeeded = true;
}

Expand Down

0 comments on commit 767eeda

Please sign in to comment.