"The SLF4JLog and
SLF4JLocationAwareLog classes are now serializable solving
serialization problems encountered with certain libraries which
attempt to serialize JCL log instances."<br><br><cite>www.<b>slf4j</b>.<b>org</b>/news.html<br><br>So why doesn't </cite>org.slf4j.Logger extend java.io.Serializable?<br><br><dl><dt><pre>public class <b><b style="color: black; background-color: rgb(255, 255, 102);">SLF4JLog</b></b><dt>
extends <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></dt><dt>implements <a href="http://www.slf4j.org/apidocs/org/apache/commons/logging/Log.html" title="interface in org.apache.commons.logging">Log</a>, <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a></dt>
</pre></dt></dl>
<p>
Implementation of <a href="http://www.slf4j.org/apidocs/org/apache/commons/logging/Log.html" title="interface in org.apache.commons.logging"><code>org.apache.commons.logging.Log</code></a> interface which
delegates all processing to a wrapped <a href="http://www.slf4j.org/apidocs/org/slf4j/Logger.html" title="interface in org.slf4j"><code>org.slf4j.Logger</code></a> instance.
</p><p></p>Apparently log4j loggers are not Serializable either: <a href="http://stackoverflow.com/questions/82109/should-a-log4j-logger-be-declared-as-transient">http://stackoverflow.com/questions/82109/should-a-log4j-logger-be-declared-as-transient</a><br>
<br><div class="gmail_quote">On Fri, Dec 11, 2009 at 8:45 AM, Gavin King <span dir="ltr"><<a href="mailto:gavin.king@gmail.com">gavin.king@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Right, it's definitely not OK if injected loggers just disappear after<br>
passivation.<br>
<div><div></div><div class="h5"><br>
On Fri, Dec 11, 2009 at 11:37 AM, Dan Allen <<a href="mailto:dan.j.allen@gmail.com">dan.j.allen@gmail.com</a>> wrote:<br>
> In this case, is the transient keyword not sufficient? I guess the problem<br>
> is injection won't happen again after the object is deserialized.<br>
><br>
> Why does it always come down to loggers. Loggers are just killing Java. So I<br>
> agree, it is rather embarrassing.<br>
><br>
> -Dan<br>
><br>
> On Fri, Dec 11, 2009 at 11:27 AM, Gavin King <<a href="mailto:gavin.king@gmail.com">gavin.king@gmail.com</a>> wrote:<br>
>><br>
>> This is kind-of embarrassing:<br>
>><br>
>> <a href="http://www.seamframework.org/Community/InjectLoggerFromSlf4j" target="_blank">http://www.seamframework.org/Community/InjectLoggerFromSlf4j</a><br>
>><br>
>> We really *do* need static injection points....<br>
>><br>
>> --<br>
>> Gavin King<br>
>> <a href="mailto:gavin.king@gmail.com">gavin.king@gmail.com</a><br>
>> <a href="http://in.relation.to/Bloggers/Gavin" target="_blank">http://in.relation.to/Bloggers/Gavin</a><br>
>> <a href="http://hibernate.org" target="_blank">http://hibernate.org</a><br>
>> <a href="http://seamframework.org" target="_blank">http://seamframework.org</a><br>
>> _______________________________________________<br>
>> weld-dev mailing list<br>
>> <a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a><br>
>> <a href="https://lists.jboss.org/mailman/listinfo/weld-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/weld-dev</a><br>
><br>
><br>
><br>
> --<br>
> Dan Allen<br>
> Senior Software Engineer, Red Hat | Author of Seam in Action<br>
> Registered Linux User #231597<br>
><br>
> <a href="http://mojavelinux.com" target="_blank">http://mojavelinux.com</a><br>
> <a href="http://mojavelinux.com/seaminaction" target="_blank">http://mojavelinux.com/seaminaction</a><br>
> <a href="http://www.google.com/profiles/dan.j.allen" target="_blank">http://www.google.com/profiles/dan.j.allen</a><br>
><br>
<br>
<br>
<br>
</div></div>--<br>
<div><div></div><div class="h5">Gavin King<br>
<a href="mailto:gavin.king@gmail.com">gavin.king@gmail.com</a><br>
<a href="http://in.relation.to/Bloggers/Gavin" target="_blank">http://in.relation.to/Bloggers/Gavin</a><br>
<a href="http://hibernate.org" target="_blank">http://hibernate.org</a><br>
<a href="http://seamframework.org" target="_blank">http://seamframework.org</a><br>
_______________________________________________<br>
weld-dev mailing list<br>
<a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/weld-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/weld-dev</a><br>
</div></div></blockquote></div><br>