Filter initialization is one of the last things to happen in web app startup. The ServletContainerInitializer sets the threads logger context so that web app startup procedures can use it. The filter's init() method clears it near the end of startup so that it doesn't bleed into another web app.
Then, on web apps shutdown, destruction of filters is one of the first things to happen. The filter's destroy() sets the logger context so that the web app shutdown procedures can use it. Nick On Jan 17, 2014, at 10:17 PM, Matt Sicker wrote: > Now I'm not sure if I'm interpreting this correctly, but init() clears the > current thread's logger context, and destroy() sets it. What's up with this? > Especially since it just gets set and cleared in the doFilter() bit. > > -- > Matt Sicker <boa...@gmail.com>