java - Helpful error messages in jersey -
i implementing restful webapp in jersey on grizzly 2 server , have following class.
@path("/faulttree") public class faulttreeresource { @get @produces(mediatype.text_plain) public string sendgetjson(@queryparam("treeid") string treeid) { return "you requested fault tree number "+treeid; }
}
if go http://localhost:8080/faulttree message "request failed", because forgot query parameter. behavior makes sense in production. however, during development more helpful error message. how can enable helpful error messages or @ least logging in jersey?
the sendgetjson-method isn't executed (according eclipse debugger), logging there not option.
when want enable logging in grizzly add following code above call startserver():
logger l = logger.getlogger("org.glassfish.grizzly.http.server.httphandler"); l.setlevel(level.fine); l.setuseparenthandlers(false); consolehandler ch = new consolehandler(); ch.setlevel(level.all); l.addhandler(ch);
Comments
Post a Comment