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

Add access log handler to the main router if non-app root-path is different from root-path #26783

Merged
merged 1 commit into from
Aug 23, 2022
Merged
Show file tree
Hide file tree
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 @@ -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