All right, this is exactly what I think is happening. In fact of that, if you put a call to the toString() method explicitly in the log line, the eclipse plugin works right: <br><br>private Logger log = LoggerFactory.getLogger
(TestingLogback.class.getSimpleName());<br><br>Car car = new Car("Mercedes")<br>Integer aNumber = new Integer(2);<br>log.debug("A correct log line: {}", aNumber);<br>log.debug("A failed log line: {}",
car.toString()); <--------- toString() method called<br>log.debug("This line is unreachable for the logback plugin");<br><br>In this case, the eclipse plugin shows this output: <br><br>A correct line: 2<br>A failed log line: Mercedes
<br>This line is unreachable for the logback plugin<br><br>Your proposal for the resolution seems to be reasonable. Let's see what the developers think...<br><br><div><span class="gmail_quote">2007/9/26, Maarten Bosteels <
<a href="mailto:maarten@apache.org">maarten@apache.org</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">You are right, it doesn't work.
<br><br>I think this is happening:<br>* Logback is sending a serialized LoggingEvent over the socket<br>* the LoggingEvent has a reference to the foo.bar.Car instance<br>* the Eclipse plugin receives the bytes over the wire and tries to
<br>deserialize the LoggingEvent, this fails because the foo.bar.Car class<br>is not on the classpath.<br><br>Resolution: I think the SocketAppender should only send the formattedMessage<br>over the wire and not the argumentArray.
<br>In other words: argumentArray should be declared transient.<br><br>Let's see what the LogBack developers think about that ...<br><br>Maarten<br><br>On 9/26/07, Vicente Ferrer <<a href="mailto:vteferrer@gmail.com">
vteferrer@gmail.com</a>> wrote:<br>> Hello,<br>><br>> My problem occurs when I put an own object (like a instance of a bean named<br>> 'Car' created for me) in a logback log line. A code like this:<br>
><br>> private Logger log =<br>> LoggerFactory.getLogger(TestingLogback.class.getSimpleName<br>> ());<br>><br>> Car car = new Car("Mercedes");<br>> Integer aNumber = new Integer(2);<br>><br>
> log.debug("A correct log line: {}", aNumber);<br>> log.debug("A failed log line: {}", car);<br>> log.debug("This line is unreachable for the logback plugin");<br>><br>> The logback plugin just shows:
<br>><br>> ----<br>> A correct log line: 2<br>> ----<br>><br>> And the plugin doesn't show the rest lines of the class on the logback<br>> plugin. The "Error Log" plugin on Eclipse shows this error: "There was an
<br>> error trying to deserialize LoggingEvent:<br>> java.lang.ClassNotFoundException: foo.bar.Car". But the<br>> console appender shows correctly all the log lines (the console is showing<br>> the output of the J2EE Server, and in its classpath, logback doesn't have
<br>> any problem to reach the Car class)<br>><br>> Thanks in advance<br>><br>> 2007/9/26, Maarten Bosteels <<a href="mailto:maarten@apache.org">maarten@apache.org</a>>:<br>> > Hello,<br>> >
<br>> > I am using the LogBack Eclipse plugin.<br>> ><br>> > Eclipse version:<br>> > Version: 3.3.0<br>> > Build id: I20070621-1340<br>> ><br>> > I folowed the instructions from<br>
> <a href="http://logback.qos.ch/consolePlugin.html">http://logback.qos.ch/consolePlugin.html</a><br>> > and I just tried with the logback.xml configuration file from the<br>> > instructions, and of course it works as well.
<br>> ><br>> > What exactly isn't working for you ?<br>> ><br>> > Maarten<br>> ><br>> > On 9/26/07, Vicente Ferrer < <a href="mailto:vteferrer@gmail.com">vteferrer@gmail.com</a>> wrote:
<br>> > > Thanks for your response, Maarten.<br>> > ><br>> > > If you don't put the <consolePlugin /> tag on logback.xml, what do you<br>> do to<br>> > > show the logback log lines on eclipse plugin? Or... aren't you ussing
<br>> that<br>> > > plugin? Maybe are you using a log4j eclipse plugin, like Ganymede?<br>> > ><br>> > > Thanks again<br>> > ><br>> > > 2007/9/25, Maarten Bosteels < <a href="mailto:maarten@apache.org">
maarten@apache.org</a>>:<br>> > > > I forgot to mention that I have not tried the <consolePlugin /> tag.<br>> > > ><br>> > > > I used the following logback.xml :<br>> > > >
<br>> > > > <?xml version="1.0" encoding="UTF-8"?><br>> > > > <configuration><br>> > > > <appender class="<br>> ch.qos.logback.core.ConsoleAppender
"<br>> > > > name="RootConsoleAppender"><br>> > > > <filter<br>> > > class="ch.qos.logback.classic.filter.ThresholdFilter"><br>> > > > <level>debug</level>
<br>> > > > </filter><br>> > > > <layout<br>> > > class="ch.qos.logback.classic.PatternLayout"><br>> > > > <pattern>%d{yyyy-MM-dd HH:mm:ss},%p,%c,%t %m%n</pattern>
<br>> > > > </layout><br>> > > > </appender><br>> > > > <appender class="<br>> > > ch.qos.logback.classic.net.SocketAppender"<br>> > > > name="RootSocketAppender">
<br>> > > > <filter<br>> > > class="ch.qos.logback.classic.filter.ThresholdFilter"><br>> > > > <level>debug</level><br>> > > > </filter>
<br>> > > > <remoteHost><a href="http://mortimer.example.com">mortimer.example.com</a></remoteHost><br>> > > > <port>4321</port><br>> > > > <reconnectionDelay>30000</reconnectionDelay>
<br>> > > > <includeCallerData>true</includeCallerData><br>> > > > </appender><br>> > > ><br>> > > > <root><br>> > > > <level value="debug"/>
<br>> > > > <appender-ref ref="RootConsoleAppender"/><br>> > > > <appender-ref ref="RootSocketAppender"/><br>> > > > </root><br>> > > > </configuration>
<br>> > > ><br>> > > > Maarten<br>> > > ><br>> > > > On 9/25/07, Maarten Bosteels < <a href="mailto:maarten@apache.org">maarten@apache.org</a>> wrote:<br>> > > > > I installed it today and it works.
<br>> > > > > Haven't done extensive testing, but everything I tried (MDC and<br>> > > > > throwables) seems to work.<br>> > > > ><br>> > > > > I would have preferred that logging events were shown in a table
<br>> > > > > (column per field)<br>> > > > > instead of stringified. But I never use eclipse, so I don't really<br>> care<br>> > > :-)<br>> > > > ><br>> > > > > Is anyone working on a plugin for Intellij IDEA ?
<br>> > > > ><br>> > > > > Maarten<br>> > > > ><br>> > > > > On 9/25/07, Vicente Ferrer < <a href="mailto:vteferrer@gmail.com">vteferrer@gmail.com</a>> wrote:
<br>> > > > > > Hi to all,<br>> > > > > ><br>> > > > > > I'm having some problems with logback eclipse plugin... ¿somebody<br>> has<br>> > > used<br>> > > > > > the logback eclipse plugin with success?
<br>> > > > > ><br>> > > > > > Thanks a lot.<br>> > > > > ><br>> > > > > > _______________________________________________<br>> > > > > > logback-dev mailing list
<br>> > > > > > <a href="mailto:logback-dev@qos.ch">logback-dev@qos.ch</a><br>> > > > > > <a href="http://qos.ch/mailman/listinfo/logback-dev">http://qos.ch/mailman/listinfo/logback-dev
</a><br>> > > > > ><br>> > > > > ><br>> > > > ><br>> > > ><br>> > > > _______________________________________________<br>> > > > logback-dev mailing list
<br>> > > > <a href="mailto:logback-dev@qos.ch">logback-dev@qos.ch</a><br>> > > > <a href="http://qos.ch/mailman/listinfo/logback-dev">http://qos.ch/mailman/listinfo/logback-dev</a><br>> > > >
<br>> > > ><br>> > ><br>> > ><br>> > > _______________________________________________<br>> > > logback-dev mailing list<br>> > > <a href="mailto:logback-dev@qos.ch">
logback-dev@qos.ch</a><br>> > > <a href="http://qos.ch/mailman/listinfo/logback-dev">http://qos.ch/mailman/listinfo/logback-dev</a><br>> > ><br>> > ><br>> ><br>> > _______________________________________________
<br>> > logback-dev mailing list<br>> > <a href="mailto:logback-dev@qos.ch">logback-dev@qos.ch</a><br>> > <a href="http://qos.ch/mailman/listinfo/logback-dev">http://qos.ch/mailman/listinfo/logback-dev</a>
<br>> ><br>> ><br>><br>><br>> _______________________________________________<br>> logback-dev mailing list<br>> <a href="mailto:logback-dev@qos.ch">logback-dev@qos.ch</a><br>> <a href="http://qos.ch/mailman/listinfo/logback-dev">
http://qos.ch/mailman/listinfo/logback-dev</a><br>><br>><br><br>_______________________________________________<br>logback-dev mailing list<br><a href="mailto:logback-dev@qos.ch">logback-dev@qos.ch</a><br><a href="http://qos.ch/mailman/listinfo/logback-dev">
http://qos.ch/mailman/listinfo/logback-dev</a><br><br></blockquote></div><br>