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.

mythz
—
2017-06-30T01:43:39Z —
#2

Yeah the request logger only logs requests that were executed by Services.

jrodrigu
—
2017-06-30T16:04:28Z —
#3

What's the best way to catch these with regular logging then? Filters, or a custom httphandler?

mythz
—
2017-06-30T19:01:10Z —
#4

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.

jrodrigu
—
2017-06-30T19:38:23Z —
#5

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).

mythz
—
2017-07-01T02:28:23Z —
#6

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.