[slf4j-user] J2EE logging and loggers serialization

Claude Brisson claude at renegat.net
Fri Aug 21 17:18:31 CEST 2015


Hi.

I have some questions about using slf4j in a J2EE context:

1) I see there is a ServletContext back-end here: 
https://github.com/pmahoney/slf4j-servletcontext
but it doesn't seem referenced on the slf4j website, although it looks 
like the only way to have the webapp rely on the container logger.
Does it mean that it's a standard behavior to ignore the container logger?

2) I read in the FAQ: "As of SLF4J version 1.5.3, logger instances 
survive serialization. Thus, serialization of the host class no longer 
requires any special action, even when loggers are declared as instance 
variables."
Would this still be true when using the slf4j-servletcontext back-end? 
Let say I want to put a logger as a session attribute. Since the servlet 
context initialization may happen *after* sessions de-serialization, I 
have some doubts about it...

Thanks,

   Claude

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/slf4j-user/attachments/20150821/458ff1db/attachment.html>


More information about the slf4j-user mailing list