ServiceStack / Issues

Issue Tracker for the commercial versions of ServiceStack
11 stars 8 forks source link

RequestLogFilter is not invoked by CsvRequestLogger #780

Closed mikkeljohnsen closed 2 years ago

mikkeljohnsen commented 2 years ago

Describe the issue

CsvRequestLogger overrides the Log method but does not perform a RequestLogFilter.Invoke after CreateEntry like base.Log does.

Reproduction

Add a RequestLogsFeature with RequestLogger set to a CsvRequestLogger. Set the RequestLogFilter to something, e.g: RequestLogFilter = (request, entry) => Console.WriteLine ("foo")

Run the service and send a request that triggers logging, note that the above action is never performed. No "foo".

Try letting RequestLogger default to an InMemoryRollingRequestLogger, and perform the same test. The action is now invoked and "foo" is output.

Expected behavior

Expected same behavior regardless of RequestLogger implementation, i.e. "foo" is output.

System Info

ServiceStack.Core 6.2.0

Additional context

Likely fixed by adding RequestLogFilter?.Invoke(request, entry); after CreateEntry on line 150 in CsvRequestLogger.

Validations

mythz commented 2 years ago

This should now be fixed from v6.2.1+ that's now available on MyGet.

thx for reporting!