Open ddanny opened 11 years ago
Thanks for the feed-back. The 2.0.5 artifacts were restored in Maven (hardware failure), however we won't maintain the 2.0 branch anymore.
Otherwise, 2.1 version should work the same regarding logging, but obviously a regression was introduced.
I did some extra investigation and found out the it works fine with 2.1-M1 and doesn't work with 2.1-M2. This means that something has broken before releasing 2.1-M2.
However, it works with the slf4j restlet extension and with this line System.setProperty("org.restlet.engine.loggerFacadeClass", "org.restlet.ext.slf4j.Slf4jLoggerFacade"); instead of SLF4JBridgeHandler.install();
Indeed, this is the way to go as indicated here: http://www.restlet.org/documentation/snapshot/jee/ext/org/restlet/ext/slf4j/Slf4jLoggerFacade.html
It would be worth being more clear in the Javadocs.
Not sure if I should open a new issue, maybe I am missing something... but I cannot get this approach (setting -Dorg.restlet.engine.loggerFacadeClass=org.restlet.ext.slf4j.Slf4jLoggerFacade) working in an OSGi-context (I am using felix), I am getting a ClassNotFoundException
Oct 9, 2013 10:36:17 AM org.restlet.engine.Engine <init>
WARNING: Unable to register the logger facade
java.lang.ClassNotFoundException: org.restlet.ext.slf4j.Slf4jLoggerFacade
at org.restlet.engine.util.EngineClassLoader.findClass(EngineClassLoader.java:104)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at org.restlet.engine.Engine.<init>(Engine.java:447)
at org.restlet.engine.Engine.register(Engine.java:343)
at org.restlet.engine.internal.Activator.start(Activator.java:138)
at org.apache.felix.framework.util.SecureAction$Actions.run(SecureAction.java:1605)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:636)
at org.apache.felix.framework.Felix.activateBundle(Felix.java:1977)
at org.apache.felix.framework.Felix.startBundle(Felix.java:1895)
at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1191)
at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:295)
at java.lang.Thread.run(Thread.java:662)
The org.restlet.ext.slf4j bundle is already resolved when this happens:
g! lb restlet
START LEVEL 6
ID|State |Level|Name
21|Active | 5|org.restlet (2.1.0.v20130116-1240)
22|Active | 5|org.restlet.ext.xml (2.1.0.v20130116-1240)
23|Active | 5|org.restlet.ext.jackson (2.1.0.v20130116-1240)
24|Active | 5|org.restlet.ext.xstream (2.1.0.v20130116-1240)
25|Active | 5|org.restlet.ext.json (2.1.0.v20130116-1240)
26|Active | 5|org.restlet.ext.crypto (2.1.0.v20130116-1240)
27|Active | 5|org.restlet.ext.servlet (2.1.0.v20130116-1240)
69|Active | 3|org.restlet.ext.slf4j (2.1.0.v20130116-1240)
Tweaking my local org.restlet bundle's manifest like this
Import-Package: javax.xml.parsers;resolution:=optional,org.osgi.framewor
k;resolution:=optional,org.w3c.dom;resolution:=optional,org.w3c.dom.ls;
resolution:=optional,org.xml.sax;resolution:=optional,org.xml.sax.helpe
rs;resolution:=optional,org.restlet.ext.slf4j;resolution:=optional
made the problem go away (but I am not sure if this is the recommended approach for the restlet framework).
Restlet 2.1.4's Manifest looks the same, so i didn't try upgrading (yet).
Any hint welcome... (and, btw, thanks for this awesome framework ;))
I was a happy user of restlet 2.0.15 until yesterday, when they discontinued the 2.0.x versions from their Maven repository, so I had to upgrade to 2.1.1.
In the old version I was using SLF4J as a bridge to Log4J and I was able to get the restlet logs to my Log4J based logging system. This is no longer working with restlet 2.1.1. Any ideas what I would need to fix?
This is the way it was working:
Below is a list of the restlet and slf4j related dependencies I have in my pom.xml:
Once again, this was all working with restlet version 2.0.15, slf4j 1.6.4 and without any org.restlet.ext.slf4j dependency.