Class Log4JFilter
- java.lang.Object
-
- org.springframework.web.filter.GenericFilterBean
-
- de.hybris.platform.servicelayer.web.Log4JFilter
-
- All Implemented Interfaces:
javax.servlet.Filter,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.InitializingBean,org.springframework.context.EnvironmentAware,org.springframework.core.env.EnvironmentCapable,org.springframework.web.context.ServletContextAware
public class Log4JFilter extends org.springframework.web.filter.GenericFilterBeanAdds the remote ip address to the log4j MDC before the request gets processed and removes it afterwards.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringREMOTE_ADDRESS
-
Constructor Summary
Constructors Constructor Description Log4JFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddoFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain filterChain)Adds the ip address of the request to theMDCusing the key "RemoteAddr" before the processing of the filterChain and removes the key afterwards.
-
-
-
Field Detail
-
REMOTE_ADDRESS
public static final java.lang.String REMOTE_ADDRESS
- See Also:
- Constant Field Values
-
-
Method Detail
-
doFilter
public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain filterChain) throws java.io.IOException, javax.servlet.ServletExceptionAdds the ip address of the request to theMDCusing the key "RemoteAddr" before the processing of the filterChain and removes the key afterwards.- Throws:
java.io.IOExceptionjavax.servlet.ServletException
-
-