[slf4j-user] Why is Logger not serializable

Patrick Mohr kc7zzv at gmail.com
Thu Feb 9 19:55:18 CET 2012


On Wed, Feb 1, 2012 at 6:32 AM, <florian.huonder at itartis.ch> wrote:

> Hi all,
>
> In the FAQ of SLF4J it says "As of SLF4J version 1.5.3, logger instances
> survive serialization". For me this means that all SLF4J loggers are
> serializable. But only the Logger implementations are Serializable "not the
> interface".
> Due to this my code analysis criticizes "Non-transient non-serializable
> instance field in serializable class" for the logger.
> So my question is why does the logger interface not extend Serializable?
> From the FAQ i understand that it is part of the contract of a Logger
> implementation that it is serializable.
>
>
Is this a general comment, or do you have a problem you're trying to
solve?  I ask because making Logger static and final will usually, but no
always, do whatever you are trying to do with Serializable even better.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/slf4j-user/attachments/20120209/b303a56b/attachment.html>


More information about the slf4j-user mailing list