<PackageReference Include="Microsoft.Extensions.Logging.ApplicationInsights" Version="2.9.1" />
Steps to reproduce:
- Setup a basic ASP.NET Core application
- Configure AI using
services.AddLogging(c => c.AddApplicationInsights())
- Throw an Exception with the message "Actual exception message"
- Catch the exception and log it to an injected
ILogger using logger.LogError(ex, "Contextual message")
- Review the exception in AI
Expected:
Both "Contextual message" and "Actual exception message" are presented in the exception object in AI
Actual:
Only "Context message" is included. The actual exception message is lost.
Steps to reproduce:
services.AddLogging(c => c.AddApplicationInsights())ILoggerusinglogger.LogError(ex, "Contextual message")Expected:
Both "Contextual message" and "Actual exception message" are presented in the
exceptionobject in AIActual:
Only "Context message" is included. The actual exception message is lost.