Use an ErrorHandler, e.g. the LoggingErrorHandler:
RouteBuilder builder = new RouteBuilder() {
public void configure() {
// use logging error handler
errorHandler(loggingErrorHandler("com.mycompany.foo"));
// here is our regular route
from("{{uri.client.address}}").to("mock:out");
}
};