-
Notifications
You must be signed in to change notification settings - Fork 123
added specific ApplicationInsightsLoggerOptions to configure logging #574
added specific ApplicationInsightsLoggerOptions to configure logging #574
Conversation
@cijothomas ping :) Not sure if i had to include you in here... |
@funkycoding Thanks a lot for your contribution! And apologies for not responding quickly to the issues in this repo. We'll be more actively monitoring this repo going forward. I am not sure whether you saw this https://github.com/Microsoft/ApplicationInsights-aspnetcore/pull/570/files, but this one also introduces the notion of (If i dont hear from PR author's in couple days I'll try to merge both into a single one myself) |
@cijothomas ok! I'll await the feedback (and occasionally look to see if i can merge / implement feedback). |
@funkycoding The other PR I mentioned is in now. Can you adjust yours to take that into account? |
@cijothomas I've merged latest develop into my (local) repo, but the test project doesn't seem to work now. Hang in there... |
@cijothomas Everything builds locally. I'm able to run the |
@funkycoding A transient error occurred in our build pipeline - we can simply queue a new build to sort it out. |
Perhaps this isn't such a transient error. I'll see if I can sort it out sometime today. Apologies! |
Thanks Derek for helping here. |
PR #483 (belongs to issue #393) was made to send
ExceptionTelemetry
when the exception parameter ofpublic void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
is not null.This introduced some side effects in, for example, entity framework core. They log an exception using ILogger and then re-throw the exception to be (possibly) handled by the consumer. If the consumer then also logs that exception, we get double entries. I understand that ApplicationInsights wants to track as much as possible with less work but this introduced some quirks.
This PR proposes to introduce a
ApplicationInsightsLoggerOptions
to allow for some customization. I've tried to leave the public surface intact as much as possible and it defaults to the way it currently works.Secondly, i haven't changed the overloads in
ApplicationInsightsLoggerFactoryExtensions
, because i'm not 100% sure how you guys would like to see this 😄For significant contributions please make sure you have completed the following items: