I noticed that RequestLogFeature doesn’t seem to log 404/403s (basically any error that happens before i’m actually in the request code). Error codes generated by the actual endpoint seem to be ok. is that something I can change?
I’m using AspnetAuthProvider, in case that is gumming up the works.
The Request Logger was only meant for Service Requests but I’ve added support for other ServiceStack Requests in this commit which is available from v4.5.13 that’s now available on MyGet.
After short-circuited requests have closed the AppHost.OnEndRequest() will be called which you can override or register a AppHost.OnEndRequestCallbacks to register a delegate instead.
Please let me know if it adds the required logging.
The change does add the logging, thanks! (Didn’t need to register the delegate)
Would I use that delegate to cancel request logging of error codes I don’t care about (e.g. 302s)?
Also, it seems one consequence of this is that the short-circuited request log entry doesn’t seem to be tagged as a ErrorResponse in cases where it should be (403/404s).
I’ve added a SkipLogging predicate on RequestLogsFeature which you can use to skip ignoring requests you don’t care about, e.g. you can ignore all Redirect responses with:
The ErrorResponse is the serialized HTTP Response Body, most short-circuited requests don’t have a Response Body and the Logger doesn’t have access to the few that do as they’re written directly to the response Stream. HTTP Error Responses are determined when the Status Code >= 400.