Niklas Gustavsson wrote: > On Tue, Feb 26, 2008 at 4:37 PM, Dave Roberts > <[EMAIL PROTECTED]> wrote: >> OK, I see what you're saying, but that doesn't seem to be how it >> works. For example... >> >> (NioProcessor-2) [anonymous] [127.0.0.1] SENT: 331 Guest login okay, >> send your complete e-mail address as password. >> (NioProcessor-2) [anonymous] [127.0.0.1] RECEIVED: PASS dave@ >> (pool-1-thread-2) [] [] Anonymous login success - dave@ >> (NioProcessor-2) [anonymous] [127.0.0.1] SENT: 230 User logged in, >> proceed. >> >> The log of the successful login comes from the PASS class, with a >> simple LOG.info() call. None of the MDC information is filled in there. > > Does anyone have any input on this issue? I just debugged it some, and > MdcInjectionFilter.getProperty() will return the properties correctly, > but the will not be included in the log output. This is only happens > for MdcInjectionFilters added after an ExecutorFilter, the one before > logs the MDC as expected (as shown by the output from the > LoggingFilter in Daves log above). Removing the ExecutorFilter > resolves the issue, but that does really help of course :-) > > /niklas >
The MDC properties are stored in a ThreadLocal so if you have the logging filter before an executor filter, the MDC properties will get lost. If you put the MDC logging filter after the executor filter then it should work just fine. -Mike