
Hi, I´m an habitual user of log4j and I´m trying to port my application to logback. The first impression of this new tool was very good; the pluggin for Eclipse IDE has a good apparience. But I´m experiencing a little worrisomely problem: some logging lines cause the Eclipse plugin stops to write the rest of logging lines. If I activate a ConsoleAppender, I can view the rest of the logging lines at the standard console, but the Eclipse plugins don´t show that lines. The line causing the Eclipse plugin stops to work is: Method[] methods = clazz.getDeclaredMethods(); log.debug("method: {}", methods[i]); I´ve seen an error on the Error Log eclipse´s view saying that java.lang.reflect.Method is not Serializable, and the plugin do not show the rest of the logging lines. I´ve experimented similar error when I try to log a message line that contains an own object such as a bean. In this case, the error is a ClassNotFoundException because of the logback eclipse plugin can´t find the bean class. The bean class is in my proyect classpath and in the application server, logback goes fine because it can reach the bean class. How can I make accesible my classes to the logback plugin. Could be these two bugs of the plugin? If you need it, I can post the stacktrace of the error that appears at Eclipse Error Log View. Thanks a lot. P.D.: I´ve sent this message to the logback user´s list, but later I´ve thought the most appropiate list for this problem should be the dev list.

Hi again, I´m still experiencing the same error. This is the code, where 'log' is of org.slf4j.Logger type: log.debug("annotation {}: {}", j, annotations[j]); When 'annotations[j]' is my own annotation, the Logback plugin stops to log the rest of messages and the Error Log in Eclipse shows this stack trace: java.lang.ClassNotFoundException: org.app.util.annotation.Operation at java.lang.ClassLoader.findClass(ClassLoader.java:358) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal( BundleLoader.java:429) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass( BundleLoader.java:369) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass( BundleLoader.java:357) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass( DefaultClassLoader.java:83) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:247) at java.io.ObjectInputStream.resolveProxyClass(ObjectInputStream.java :676) at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1531) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1493) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java :1732) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1667) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java :1945) at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java :480) at ch.qos.logback.classic.spi.LoggingEvent.readObject(LoggingEvent.java :282) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke( NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke( DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java :974) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1846) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java :1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351) at ch.qos.logback.eclipse.reciever.SocketNode.run(SocketNode.java:54) at java.lang.Thread.run(Thread.java:619) If I use the toString() method of the annotation, the eclipse Logback plugin works fine. The sample code of that is: log.debug("annotation {}: {}", j, annotations[j].toString()); Do you think this is a bug? It seems ' ch.qos.logback.classic.spi.LoggingEvent.readObject' can´t reach the class ' org.app.util.annotation.Operation' in my Eclipse´s classpath. How can I solve this problem? Thanks a lot. ---------- Forwarded message ---------- From: Vicente Ferrer <vteferrer@gmail.com> Date: 14-sep-2007 21:56 Subject: Unexpected problem with logback To: logback-dev@qos.ch Hi, I´m an habitual user of log4j and I´m trying to port my application to logback. The first impression of this new tool was very good; the pluggin for Eclipse IDE has a good apparience. But I´m experiencing a little worrisomely problem: some logging lines cause the Eclipse plugin stops to write the rest of logging lines. If I activate a ConsoleAppender, I can view the rest of the logging lines at the standard console, but the Eclipse plugins don´t show that lines. The line causing the Eclipse plugin stops to work is: Method[] methods = clazz.getDeclaredMethods(); log.debug("method: {}", methods[i]); I´ve seen an error on the Error Log eclipse´s view saying that java.lang.reflect.Method is not Serializable, and the plugin do not show the rest of the logging lines. I´ve experimented similar error when I try to log a message line that contains an own object such as a bean. In this case, the error is a ClassNotFoundException because of the logback eclipse plugin can´t find the bean class. The bean class is in my proyect classpath and in the application server, logback goes fine because it can reach the bean class. How can I make accesible my classes to the logback plugin. Could be these two bugs of the plugin? If you need it, I can post the stacktrace of the error that appears at Eclipse Error Log View. Thanks a lot. P.D.: I´ve sent this message to the logback user´s list, but later I´ve thought the most appropiate list for this problem should be the dev list.
participants (1)
-
Vicente Ferrer