|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.web.filter.GenericFilterBean
org.springframework.web.filter.OncePerRequestFilter
org.dellroad.stuff.servlet.ExceptionLoggingFilter
public class ExceptionLoggingFilter
Servlet filter that ensures any exceptions which are not handled by the servlet get logged somewhere.
| Field Summary |
|---|
| Fields inherited from class org.springframework.web.filter.OncePerRequestFilter |
|---|
ALREADY_FILTERED_SUFFIX |
| Fields inherited from class org.springframework.web.filter.GenericFilterBean |
|---|
logger |
| Constructor Summary | |
|---|---|
ExceptionLoggingFilter()
|
|
| Method Summary | |
|---|---|
void |
doFilterInternal(HttpServletRequest request,
HttpServletResponse response,
FilterChain filterChain)
Process the request. |
protected Logger |
getLogger(Throwable t)
Get the logging destination. |
protected void |
logException(Throwable t)
Log an exception caught by this instance. |
protected boolean |
shouldLogException(Throwable t)
Determine if an exception caught by this instance should be logged. |
| Methods inherited from class org.springframework.web.filter.OncePerRequestFilter |
|---|
doFilter, getAlreadyFilteredAttributeName, shouldNotFilter |
| Methods inherited from class org.springframework.web.filter.GenericFilterBean |
|---|
addRequiredProperty, afterPropertiesSet, destroy, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setServletContext |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ExceptionLoggingFilter()
| Method Detail |
|---|
public void doFilterInternal(HttpServletRequest request,
HttpServletResponse response,
FilterChain filterChain)
throws IOException,
ServletException
doFilterInternal in class OncePerRequestFilterIOException
ServletExceptionshouldLogException(java.lang.Throwable)protected boolean shouldLogException(Throwable t)
The implementation in ExceptionLoggingFilter returns true except for
SocketException (typically caused by the client disconnecting) and ThreadDeath
(typically caused by virtual machine shutdown).
Subclasses should override if necessary.
t - exception caught by this instanceprotected void logException(Throwable t)
The implementation in ExceptionLoggingFilter logs the exception as an error via the logger
returned by getLogger().
Subclasses should override if necessary.
t - exception caught by this instanceprotected Logger getLogger(Throwable t)
The implementation in ExceptionLoggingFilter uses the Logger returned by
LoggerFactory.getLogger(java.lang.String) when passed this instance's class as the parameter.
Subclasses should override if necessary.
t - the exception about to be logged
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||