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