improved logging
This commit is contained in:
@ -21,6 +21,8 @@ import javax.interceptor.AroundInvoke;
|
|||||||
import javax.interceptor.InvocationContext;
|
import javax.interceptor.InvocationContext;
|
||||||
import javax.validation.ConstraintViolationException;
|
import javax.validation.ConstraintViolationException;
|
||||||
import javax.ws.rs.core.Response;
|
import javax.ws.rs.core.Response;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -28,6 +30,8 @@ import javax.ws.rs.core.Response;
|
|||||||
*/
|
*/
|
||||||
public class APIExceptionInterceptor {
|
public class APIExceptionInterceptor {
|
||||||
|
|
||||||
|
private static final Logger LOGGER = LoggerFactory.getLogger(APIExceptionInterceptor.class);
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
Locale locale;
|
Locale locale;
|
||||||
|
|
||||||
@ -53,6 +57,11 @@ public class APIExceptionInterceptor {
|
|||||||
} else {
|
} else {
|
||||||
errorResponse = new APIException(ex, locale).getHttpResponse();
|
errorResponse = new APIException(ex, locale).getHttpResponse();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug(ex.toString(), ex);
|
||||||
|
}
|
||||||
|
|
||||||
return errorResponse;
|
return errorResponse;
|
||||||
}
|
}
|
||||||
return proceedResponse;
|
return proceedResponse;
|
||||||
|
|||||||
Reference in New Issue
Block a user