Skip to content

Commit 2aed618

Browse files
cYKatherineRelease Workflow
andauthored
UID2-4667 Log participant name (#334)
* Log participant name * [CI Pipeline] Released Snapshot version: 2.30.20-alpha-153-SNAPSHOT --------- Co-authored-by: Release Workflow <[email protected]>
1 parent bda819d commit 2aed618

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.uid2</groupId>
88
<artifactId>uid2-core</artifactId>
9-
<version>2.30.19</version>
9+
<version>2.30.20-alpha-153-SNAPSHOT</version>
1010

1111
<properties>
1212
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

src/main/java/com/uid2/core/handler/GenericFailureHandler.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package com.uid2.core.handler;
22

3+
import com.uid2.shared.auth.IAuthorizable;
4+
import com.uid2.shared.auth.OperatorKey;
5+
import com.uid2.shared.middleware.AuthMiddleware;
36
import io.vertx.core.Handler;
47
import io.vertx.core.http.HttpClosedException;
58
import io.vertx.core.http.HttpServerResponse;
@@ -19,11 +22,18 @@ public void handle(RoutingContext ctx) {
1922
String url = ctx.normalizedPath();
2023
Throwable t = ctx.failure();
2124

25+
final IAuthorizable profile = AuthMiddleware.getAuthClient(ctx);
26+
final OperatorKey operatorKey = profile instanceof OperatorKey ? (OperatorKey) profile : null;
27+
String participant = "unknown";
28+
if (operatorKey != null) {
29+
participant = operatorKey.getName();
30+
}
31+
2232
if (t != null) {
2333
if (statusCode >= 500 && statusCode < 600) { // 5xx is server error, so error
24-
LOGGER.error("URL: [{}] - Error response code: [{}] - Error:", url, statusCode, t);
34+
LOGGER.error("URL: [{}], Participant: [{}] - Error response code: [{}] - Error:", url, participant, statusCode, t);
2535
} else if (statusCode >= 400 && statusCode < 500) { // 4xx is user error, so just warn
26-
LOGGER.warn("URL: [{}] - Error response code: [{}] - Error:", url, statusCode, t);
36+
LOGGER.warn("URL: [{}], Participant: [{}] - Error response code: [{}] - Error:", url, participant, statusCode, t);
2737
}
2838
}
2939

0 commit comments

Comments
 (0)