2

I have some code that is using the Restlet framework. It is writing an ERROR into my log4j log file:

2012-05-30 12:16:42,169 3278917 ERROR [STDERR] (Thread-97:) 30-May-2012 12:16:42 org.restlet.engine.http.connector.HttpClientHelper start
INFO: Starting the default HTTP client

Is there any way I can turn this logging off? I see there is a Client.getLogger(), but I can't see a way to use that to turn logging off.

sashkello
  • 17,306
  • 24
  • 81
  • 109
user265330
  • 2,533
  • 6
  • 31
  • 42

2 Answers2

3

You can rely on regular Java logging configuration (java.util.logging). Restlet Framework provides a simple way to adjust those properties, programmatically. Call for example:

org.restlet.engine.Engine.setLogLevel(Level.OFF);
sashkello
  • 17,306
  • 24
  • 81
  • 109
Jerome Louvel
  • 2,882
  • 18
  • 19
0

Hi it maybe a little late but for me the following code did it:

ClientResource resource = new ClientResource();
resource.getLogger().setLevel(Level.WARNING); //<-- important

I left out the resource configuration and exectution because they are not important;-)

Tarken
  • 2,112
  • 2
  • 23
  • 42