Skip to content

Commit

Permalink
[feat:4099] gateway log ip info (#4100)
Browse files Browse the repository at this point in the history
[feat:4099] gateway log ip info (#4100)
  • Loading branch information
aiceflower authored Feb 16, 2023
1 parent 80be574 commit 25ae320
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,6 @@ class DefaultGatewayRouter(var gatewayRouters: Array[GatewayRouter]) extends Abs
gatewayContext.getResponse.sendResponse()
return null
}
logger.info(
"GatewayRouter route requestUri " + gatewayContext.getGatewayRoute.getRequestURI + " with parsedService " + parsedService + " to " + serviceInstance
)
serviceInstance
} else null

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,21 @@ private Mono<Void> gatewayDeal(
return gatewayHttpResponse.getResponseMono();
}
serviceInstance = router.route(gatewayContext);
if (serviceInstance != null) {
logger.info(
"Client request ip: "
+ gatewayContext.getRequest().getRemoteAddress()
+ " and uri: "
+ gatewayContext.getRequest().getRequestURI()
+ "GatewayRouter route requestUri: "
+ gatewayContext.getGatewayRoute().getRequestURI()
+ " with parsedService "
+ gatewayContext.getGatewayRoute().getServiceInstance().getApplicationName()
+ " to "
+ serviceInstance);
} else {
logger.info("Client request uri: " + gatewayContext.getRequest().getRequestURI());
}
} catch (Throwable t) {
logger.warn("", t);
Message message = Message.error(t).$less$less(gatewayContext.getRequest().getRequestURI());
Expand Down

0 comments on commit 25ae320

Please sign in to comment.