You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wink.apache.org by Jason Dillon <ja...@planet57.com> on 2010/09/17 20:29:18 UTC

Using of throw new WebApplicationException and logging

IIUC, use of throw new WebApplicationException(...) is normal and used to send a response back, w/o needing to explicitly mark a resource method return a Response.  Why then does Wink log this?

<snip>
jvm 1    | INFO  [qtp1618389807-26] o.a.w.s.i.RequestProcessor - The following error occurred during the invocation of the handlers chain: WebApplicationException (404 - Not Found) while processing GET request sent to http://localhost:8080/rest/jobs/foo/1
</snip>

I'm using this in several places, to send 404, 401 or 204 (others too).  I don't see why this needs to be logged, its normal operations isn't it?  A 5xx might need to be logged, but I'm not so sure that the added detail in the log for other status types is helpful, may even be harmful if a resources is expected to return varying status types.

I suppose I could introduce another exception, and implement an exception mapper to avoid the logging, but I'm curious why that logging is there, and why its logged as INFO?

--jason