You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by bd...@apache.org on 2023/01/11 01:28:28 UTC
[directory-scimple] branch log-spam-mapper created (now a40a8a6c)
This is an automated email from the ASF dual-hosted git repository.
bdemers pushed a change to branch log-spam-mapper
in repository https://gitbox.apache.org/repos/asf/directory-scimple.git
at a40a8a6c Log uncaught client errors at DEBUG level, server errors at WARN
This branch includes the following new commits:
new a40a8a6c Log uncaught client errors at DEBUG level, server errors at WARN
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[directory-scimple] 01/01: Log uncaught client errors at DEBUG level, server errors at WARN
Posted by bd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
bdemers pushed a commit to branch log-spam-mapper
in repository https://gitbox.apache.org/repos/asf/directory-scimple.git
commit a40a8a6ce0c8aff3fa239be63f9775c9ba3eb184
Author: Brian Demers <bd...@apache.org>
AuthorDate: Tue Jan 10 20:28:22 2023 -0500
Log uncaught client errors at DEBUG level, server errors at WARN
---
.../directory/scim/server/exception/BaseScimExceptionMapper.java | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/scim-server/src/main/java/org/apache/directory/scim/server/exception/BaseScimExceptionMapper.java b/scim-server/src/main/java/org/apache/directory/scim/server/exception/BaseScimExceptionMapper.java
index 1f466579..37675a45 100644
--- a/scim-server/src/main/java/org/apache/directory/scim/server/exception/BaseScimExceptionMapper.java
+++ b/scim-server/src/main/java/org/apache/directory/scim/server/exception/BaseScimExceptionMapper.java
@@ -15,7 +15,12 @@ abstract class BaseScimExceptionMapper<E extends Throwable> implements Exception
@Override
public Response toResponse(E throwable) {
Response response = errorResponse(throwable).toResponse();
- log.warn("Returning error status: {}", response.getStatus(), throwable);
+ // log client errors (e.g. 404s) at debug, and anything else at warn
+ if (Response.Status.Family.CLIENT_ERROR.equals(response.getStatusInfo().getFamily())) {
+ log.debug("Returning error status: {}", response.getStatus(), throwable);
+ } else {
+ log.warn("Returning error status: {}", response.getStatus(), throwable);
+ }
response.getHeaders().putSingle(HttpHeaders.CONTENT_TYPE, Constants.SCIM_CONTENT_TYPE);
return response;
}