This filter will inject some key IoSession properties into the Mapped Diagnostic Context (MDC)
These properties will be set in the MDC for all logging events that are generated down the call stack, even in code that is not aware of MINA. By default, the following properties will be set for all transports:
- "handlerClass"
- "remoteAddress"
- "localAddress"
When
session.getTransportMetadata().getAddressType() == InetSocketAddress.class
the following properties will also be set:
- "remoteIp"
- "remotePort"
- "localIp"
- "localPort"
User code can also add properties to the context, via If you only want the MDC to be set for the IoHandler code, it's enough to add one MdcInjectionFilter at the end of the filter chain. If you want the MDC to be set for ALL code, you should add an MdcInjectionFilter to the start of the chain and add that same MdcInjectionFilter instance after EVERY ExecutorFilter in the chain Thus it's ok to have one instance of the MdcInjectionFilter and add it multiple times to the chain but you should avoid adding multiple instances to the chain.
@author The Apache MINA Project (dev@mina.apache.org)
@version $Rev: 566952 $, $Date: 2007-08-17 09:25:04 +0200 (vr, 17 aug 2007) $