Skip to content

Commit

Permalink
Fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rpanchyk committed Sep 11, 2020
1 parent 659b36d commit 8c672e7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions docs/endpoints/logging/httpinteraction.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Enable HTTP interaction logging endpoint

This endpoint has a path `/logging/httpinteraction` by default (can be configured).

This endpoint turns on temporary logging of raw HTTP requests and responses, mainly for troubleshooting production issues.

Interaction is logged at `INFO` level using `http-interaction` logback logger so make sure this logger has at least
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ private HttpLogSpec.Endpoint readEndpoint(MultiMap parameters) {

private Integer readStatusCode(MultiMap parameters) {
final Integer statusCode = getIntParameter(STATUS_CODE_PARAMETER, parameters);

if (statusCode != null && (statusCode < 200 || statusCode > 500)) {
throw new InvalidRequestException(String.format(
"Parameter '%s' must be between %d and %d", STATUS_CODE_PARAMETER, 200, 500));
Expand All @@ -79,7 +80,7 @@ private int readLimit(MultiMap parameters) {

if (limit < 1 || limit > maxLimit) {
throw new InvalidRequestException(String.format(
"Parameter '%s' must be between %d and %d", LIMIT_PARAMETER, 0, maxLimit));
"Parameter '%s' must be between %d and %d", LIMIT_PARAMETER, 1, maxLimit));
}

return limit;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ CustomizedAdminEndpoint cacheInvalidateNotificationEndpoint(

@Bean
@ConditionalOnExpression("${admin-endpoints.logging-httpinteraction.enabled} == true")
CustomizedAdminEndpoint loggingHttpinteractionEndpoint(
CustomizedAdminEndpoint loggingHttpInteractionEndpoint(
@Value("${logging.http-interaction.max-limit}") int maxLimit,
HttpInteractionLogger httpInteractionLogger,
@Value("${admin-endpoints.logging-httpinteraction.path}") String path,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public void shouldRespondWithErrorWhenLimitNotValid() {

// then
verify(httpResponse).setStatusCode(eq(400));
verify(httpResponse).end(eq("Parameter 'limit' must be between 0 and 5"));
verify(httpResponse).end(eq("Parameter 'limit' must be between 1 and 5"));

verifyZeroInteractions(httpInteractionLogger);
}
Expand Down

0 comments on commit 8c672e7

Please sign in to comment.