11package 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 ;
36import io .vertx .core .Handler ;
47import io .vertx .core .http .HttpClosedException ;
58import 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