user265330
user265330

Reputation: 2553

Can I turn logging off in Restlet framework?

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.

Upvotes: 2

Views: 1738

Answers (2)

Jerome Louvel
Jerome Louvel

Reputation: 2892

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);

Upvotes: 3

Tarken
Tarken

Reputation: 2202

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;-)

Upvotes: 0

Related Questions