ardalis / Specification

Base class with tests for adding specifications to a DDD model
MIT License
1.83k stars 238 forks source link

Logging in the Package #362

Open ardalis opened 9 months ago

ardalis commented 9 months ago

Based on these docs: https://learn.microsoft.com/en-us/dotnet/core/extensions/logging-library-authors

Is there any logging that would be worthwhile for users of the Specification package (or its Repository base types)?

fiseni commented 9 months ago

Not really. The EF will emit logs anyway. Since we're using consumers' DbContext, the logging is included based on their respective configuration. Other than that, I can't think of anything worthwhile.

ardalis commented 9 months ago

I sometimes create logging decorators for repos that include timers so I can determine which queries are slow - might that be useful? EF logging doesn't provide this in a nice manner.

fiseni commented 9 months ago

What would the logging content look like in that case? Also, will you depend on DateTime?

fiseni commented 6 months ago

Now that the OTEL is becoming a standard, perhaps we should add distributed tracing instrumentation using Activity. That makes more sense than logging. Also, we may publish metrics, that might be useful for perf analysis. We need to analyze and invest in this.