Skip to content
Snippets Groups Projects
Commit 895ffdbb authored by Neelesh Thakur's avatar Neelesh Thakur
Browse files

add user info on error

parent 4f02dd46
No related branches found
No related tags found
1 merge request!348add subscriber notification request request/dependency logging
Pipeline #166747 failed
......@@ -29,7 +29,7 @@ public class SubscriberNotificationRequestLogger implements ISubscriberNotificat
.build();
final String data = response.isSuccessCode()
? String.format("notificationId=%s subscriptionId=%s", notificationId, subscription.getId())
: String.format("notificationId=%s subscriptionId=%s response=%s", notificationId, subscription.getId(), response.getBody());
: String.format("notificationId=%s subscriptionId=%s createdBy=%s response=%s", notificationId, subscription.getId(), subscription.getCreatedBy(), response.getBody());
loggingOptions.setData(data);
this.dependencyLogger.logDependency(loggingOptions);
}
......
......@@ -68,7 +68,7 @@ public class SubscriberNotificationRequestLoggerTest {
ArgumentCaptor<DependencyLoggingOptions> loggingOptionsArgumentCaptor = ArgumentCaptor.forClass(DependencyLoggingOptions.class);
verify(dependencyLogger, times(1)).logDependency(loggingOptionsArgumentCaptor.capture());
DependencyLoggingOptions actualLoggingOptions = loggingOptionsArgumentCaptor.getValue();
verifyDependencyLogging(actualLoggingOptions, "notificationId=test-notification-id subscriptionId=id_1 response=unauthorized", "http://challenge", 403, false);
verifyDependencyLogging(actualLoggingOptions, "notificationId=test-notification-id subscriptionId=id_1 createdBy=test@test.com response=unauthorized", "http://challenge", 403, false);
}
private void verifyDependencyLogging(DependencyLoggingOptions capturedLoggingOptions, String data, String target, int resultCode, boolean success) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment