microsoft / ApplicationInsights-dotnet-logging

.NET Logging adaptors
106 stars 49 forks source link

ILogger - Exception.Message is populated as ExceptionTelemetry.Message, Bump version #282

Closed cijothomas closed 5 years ago

cijothomas commented 5 years ago

ILogger - If an exception is passed to log, then Exception.Message is populated as ExceptionTelemetry.Message.

If TrackExceptionsAsExceptionTelemetry is false, then Exception.Message is stored as custom property "ExceptionMessage"

Foe example, consider the following log call. testLogger.LogError(new Exception("ExceptionMessage"), "LoggerMessage"); The ExceptionTelemetry created will contain "ExceptionMessage" in its Message field. "LoggerMessage" will be in custom property "FormattedMessage"

If TrackExceptionsAsExceptionTelemetry is false, then TraceTelemetry is created, and "LoggerMessage" will be in its Message field. "ExceptionMessage" will be in custom property "ExceptionMessage"

Prior to this, when an exception is passed to log, its Exception.Message was not stored anywhere.

Also bumped and updated versions.

RamjotSingh commented 5 years ago

How does this behave when users use LogError with exception object in it? I think we might be regressing that here.

cijothomas commented 5 years ago

@RamjotSingh i have edited to give example. (I submitted PR with empty description, sorry)

cijothomas commented 5 years ago

/azp run

cijothomas commented 5 years ago

/AzurePipelines run

cijothomas commented 5 years ago

/AzurePipelines help

azure-pipelines[bot] commented 5 years ago

For the Azure DevOps organization bhyada, no matching pipelines using the Azure Pipelines app were found for this pull request.

azure-pipelines[bot] commented 5 years ago

For the Azure DevOps organization bhyada, no matching pipelines using the Azure Pipelines app were found for this pull request.

azure-pipelines[bot] commented 5 years ago
Supported commands
     help:
          Get descriptions, examples and documentation about supported commands
          Example: help "command_name"
     run:
          Run all pipelines or a specific pipeline for this repository using a comment. Use
          this command by itself to trigger all related pipelines, or specify a pipeline
          to run.
          Example: "run" or "run pipeline_name"

See additional documentation.