On 3/13/07, <b class="gmail_sendername">Christian Stein</b> <<a href="mailto:sormuras@gmx.net">sormuras@gmx.net</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Trustin Lee schrieb:<br>> On 3/13/07, *Ceki Gülcü* <<a href="mailto:listid@qos.ch">listid@qos.ch</a> <mailto:<a href="mailto:listid@qos.ch">listid@qos.ch</a>>> wrote:<br>><br>> At 02:09 PM 3/12/2007, Holger Hoffstaette wrote:
<br>> >On Sun, 11 Mar 2007 22:29:03 +0000, Jeremy Booth wrote:<br>> ><br>> > > Is there a reason why the adapters don't implement serializable<br>> other than<br>> > > a lack of demand? Would it be possible to make them
<br>> serializable so I can<br>> > > switch?, looking at the javadocs I assume it would be the<br>> logger adapter<br>> > > implementations, org.slf4j.spi.LocationAwareLogger and<br>
> org.slf4j.Logger<br>> > > that would need the change.<br>> ><br>> >I don't think this is either necessary or desirable. If your<br>> classes are<br>> >Serializable, make the loggers transient and override readResolve() to
<br>> >recreate/set the log instance. Cuts down on useless serialization<br>> overhead<br>> >too!<br>><br>> Sounds pretty reasonable to me. Jeremy, would Holger's suggestion above
<br>> work for you?<br>><br>><br>> Implementing readResolve() for every class with a logger field is<br>> painful. Would there be any easier way? Of course, the easiest<br>> solution is not to use logger for serializable objects, which might make
<br>> sense.<br><br>Or use the static logger per class approach.<br>Although, not recommended [1], it could solve the resurrection problems.<br>Or is static a no-go in your scenario?</blockquote><div><br>It's OK in my scenario, but I just wanted to say that it's very cumbersome if there's such a scenario.
<br><br>Trustin<br></div></div>-- <br>what we call human nature is actually human habit<br>--<br><a href="http://gleamynode.net/">http://gleamynode.net/</a><br>--<br>PGP Key ID: 0x0255ECA6