You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by sf...@apache.org on 2015/11/07 00:03:23 UTC
[10/16] usergrid git commit: Don't log ERROR stack traces for errors
< 500 (especially 504s).
Don't log ERROR stack traces for errors < 500 (especially 504s).
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/6b58d3e4
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/6b58d3e4
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/6b58d3e4
Branch: refs/heads/jackson-exclusion
Commit: 6b58d3e42417335a40be99671cde1451eec28252
Parents: 6dfa2e2
Author: Mike Dunker <md...@apigee.com>
Authored: Fri Nov 6 12:28:45 2015 -0800
Committer: Mike Dunker <md...@apigee.com>
Committed: Fri Nov 6 12:28:45 2015 -0800
----------------------------------------------------------------------
.../usergrid/rest/exceptions/AbstractExceptionMapper.java | 8 ++------
.../apache/usergrid/services/AbstractCollectionService.java | 6 ++++--
2 files changed, 6 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/6b58d3e4/stack/rest/src/main/java/org/apache/usergrid/rest/exceptions/AbstractExceptionMapper.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/exceptions/AbstractExceptionMapper.java b/stack/rest/src/main/java/org/apache/usergrid/rest/exceptions/AbstractExceptionMapper.java
index a359618..9e0f359 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/exceptions/AbstractExceptionMapper.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/exceptions/AbstractExceptionMapper.java
@@ -69,15 +69,11 @@ public abstract class AbstractExceptionMapper<E extends java.lang.Throwable> imp
if ( status >= 500 ) {
// only log real errors as errors
- logger.error( e.getClass().getCanonicalName() + " Server Error (" + status + ")", e );
+ logger.error( e.getClass().getCanonicalName() + " 5XX Uncaught Exception (" + status + ")", e );
} else {
if (logger.isDebugEnabled()) {
- logger.debug(e.getClass().getCanonicalName() + " Server Error (" + status + ")", e);
- }
- switch (status){
- case 200 : logger.debug("Uncaught Exception", e); break;
- default: logger.error("Uncaught Exception", e);
+ logger.debug(e.getClass().getCanonicalName() + " Uncaught Exception (" + status + ")", e);
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/6b58d3e4/stack/services/src/main/java/org/apache/usergrid/services/AbstractCollectionService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/AbstractCollectionService.java b/stack/services/src/main/java/org/apache/usergrid/services/AbstractCollectionService.java
index 25c3fd8..607c476 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/AbstractCollectionService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/AbstractCollectionService.java
@@ -55,7 +55,7 @@ public class AbstractCollectionService extends AbstractService {
if ( !isRootService() ) {
return null;
}
- Entity entity = em.get( new SimpleEntityRef( getEntityType(), uuid ));
+ Entity entity = em.get(new SimpleEntityRef(getEntityType(), uuid));
if ( entity != null ) {
entity = importEntity( request, entity );
}
@@ -94,7 +94,9 @@ public class AbstractCollectionService extends AbstractService {
}
if ( entity == null ) {
- logger.info( "miss on entityType: {} with uuid: {}", getEntityType(), id );
+ if (logger.isDebugEnabled()) {
+ logger.debug("miss on entityType: {} with uuid: {}", getEntityType(), id);
+ }
String msg = "Cannot find entity associated with uuid: " + id;
throw new EntityNotFoundException( msg );
}