Logging with log4j

I was a happy restut 2.0.15 user until yesterday, when they seemed to have discontinued version 2.0.x from their Maven repository, so I had to upgrade to 2.1.1.

In the old version, I used SLF4J as a bridge for Log4J, and I was able to get the registry logs into the Log4J logging system. This no longer works with reslit 2.1.1. Any ideas I will need to fix?

So it works:

public static void initLogging() { // install the SL4J bridge such as the org.restlet logging messages to // be appended to Log4J too, from the default java.util.logging based // implementation SLF4JBridgeHandler.install(); ... if (log4j != null) { DOMConfigurator.configure(log4j); } log = Logger.getLogger(SomeClass.class); } 
+4
source share
2 answers

We encountered a hardware failure this weekend and will gradually restore 2.0.x artifacts in our Maven repository (versions prior to 2.0.10 are already available).

However, branch 2.0 has reached its end of life, so upgrading to version 2.1.1 is certainly a good idea.

As far as I know, the SLF4J extension has not changed at all from 2.0, only log levels were installed and JULI software control was added. Maybe it broke something.

Could you introduce a problem on GitHub?

+3
source

I found that it works fine with the slf4j restlet extension and with this line:

 System.setProperty("org.restlet.engine.loggerFacadeClass", "org.restlet.ext.slf4j.Slf4jLoggerFacade"); 

instead

 SLF4JBridgeHandler.install(); 
+1
source

All Articles