<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Florian,<br>
<br>
According to Effective Java the Serializable mechanism (like
other "marker interfaces") has problems and so to avoid "infecting"
all implementations (requiring them to actually implement
Serializable) you're supposed to just mark the implementation
classes.<br>
<br>
The code-analysis tool is right in the sense you could end up
using a Logger implementation which is *not* serializable (I believe
Logback is). You can either depend on Logback directly or ask the
code analysis tool to suppress the warning for this field.<br>
<br>
Gili<br>
<br>
On 01/02/2012 9:32 AM, <a class="moz-txt-link-abbreviated" href="mailto:florian.huonder@itartis.ch">florian.huonder@itartis.ch</a> wrote:
<blockquote
cite="mid:OFF4AE6387.3A028696-ONC1257997.004FCFFE-C1257997.004FD828@netgrouper.ch"
type="cite"><font face="sans-serif" size="2">Hi all,</font>
<br>
<br>
<font face="sans-serif" size="2">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".</font>
<br>
<font face="sans-serif" size="2">Due to this my code analysis
criticizes
"Non-transient non-serializable instance field in serializable
class"
for the logger.</font>
<br>
<font face="sans-serif" size="2">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.</font>
<br>
<br>
<font face="sans-serif" size="2">Best regards,</font>
<br>
<font face="sans-serif" size="2">Florian</font>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
slf4j-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:slf4j-user@qos.ch">slf4j-user@qos.ch</a>
<a class="moz-txt-link-freetext" href="http://mailman.qos.ch/mailman/listinfo/slf4j-user">http://mailman.qos.ch/mailman/listinfo/slf4j-user</a></pre>
</blockquote>
<br>
</body>
</html>