I have a Restlet webservice and I want to remove the debug statements in the log that Restlet creates when a request is made. Currently I am using this code to redirect the Restlet logging to my log file instead of console output by doing this:
Slf4jLoggerFacade loggerFacade = new Slf4jLoggerFacade();
Engine.getInstance().setLoggerFacade(loggerFacade);
In my log4j.properties file I have this:
log4j.rootLogger=WARNING, LOGFILE
My problem is that it still shows the debug entries in the log saying that it received the requests. This causes the log file to be a huge file size because of all the debug statements.
I also tried this to remove the debug statements but it did not work:
Engine.setLogLevel(Level.WARNING);
as well as tried this:
Engine.setRestletLogLevel(Level.WARNING);
Why is my log4j.properties file not working?
Here is some debug entries from the log that I want to remove:
Nov 29 00:00:01 DEBUG org.restlet log Host: ip:8182
Nov 29 00:00:01 DEBUG org.restlet log Connection: keep-alive
Nov 29 00:00:01 DEBUG t.SpringComponent.ServerRouter fine Default virtual host selected
Nov 29 00:00:01 DEBUG t.SpringComponent.ServerRouter fine Base URI: "http://ip:8182". Remaining part: "/getFoo?foo=Foo%2Ffoo&fileName=foo.bin"
Solved it! It was not a Restlet issue more of a not knowing log4j well enough. I was setting the log4j level to WARNING instead of WARN. Here is my settings in the log4j that solved my problem. :)
log4j.rootLogger=ERROR, LOGFILE
log4j.logger.org.restlet=WARN
log4j.logger.org.springframework=WARN