I have created a simple REST server using Restlet 2.1.2 and it is working very well. Every POST or GET request causes Restlet to emit a log message of the form:
2013-05-02 19:44:39 127.0.0.1 - - 8081 POST /rest/dispatch - 200 - - 21 http://127.0.0.1:8081Restlet-Framework/2.1.2 -
There are a lot of requests and it is not important for the application to collect those messages. Questions:
Thanks a lot for any information.
PS: I found some links which seem relevant, although I haven't yet puzzled out exactly what needs to be done. I'll leave these here for future reference.
Simply create and set a NullLogService that says all requests are not loggable:
public class NullLogService extends LogService
{
@Override
public boolean isLoggable(Request request) {
return false;
}
}
and then set that as your log service:
public static void main(String[] args) throws Exception {
Component component = new Component();
component.getServers().add(Protocol.HTTP, 8082);
Application application = new RestletTestResource();
component.getDefaultHost().attach(application);
component.setLogService(new NullLogService());
component.start();
}