Skip to content

Commit

Permalink
Added Logs
Browse files Browse the repository at this point in the history
  • Loading branch information
nitinPaypay committed Oct 12, 2020
1 parent 105b9ea commit 9bb50b6
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,15 @@ protected String formatRequest(Request request) {

protected void publishMetrics(ServeEvent event){
if(Objects.nonNull(meterRegistry)) {
String uri = event.getStubMapping().getRequest().getUrlPath().isEmpty()?
event.getStubMapping().getRequest().getUrlPathPattern(): event.getStubMapping().getRequest().getUrlPath();
notifier().info("Publishing Metrics for URI: " + uri);
notifier().info("Publishing Metrics for getUrlPath: " + event.getStubMapping().getRequest().getUrlPath());
notifier().info("Publishing Metrics for getUrl: " + event.getStubMapping().getRequest().getUrl());
notifier().info("Publishing Metrics for getUrlPathPattern: " + event.getStubMapping().getRequest().getUrlPathPattern());
notifier().info("Publishing Metrics for getUrlPattern: " + event.getStubMapping().getRequest().getUrlPattern());
notifier().info("Publishing Metrics for URI: " + event.getRequest().getUrl());
String uri = event.getRequest().getUrl();
if(event.getResponse().getStatus() == 200){
notifier().info("Publishing Metrics for getUrlPath: " + event.getStubMapping().getRequest().getUrlPath());
notifier().info("Publishing Metrics for getUrl: " + event.getStubMapping().getRequest().getUrl());
notifier().info("Publishing Metrics for getUrlPathPattern: " + event.getStubMapping().getRequest().getUrlPathPattern());
notifier().info("Publishing Metrics for getUrlPattern: " + event.getStubMapping().getRequest().getUrlPattern());
}

meterRegistry.summary(HTTP_SERVER_REQUESTS,
"uri", uri,
"status", Integer.toString(event.getResponse().getStatus()))
Expand Down

0 comments on commit 9bb50b6

Please sign in to comment.