This repository has been archived by the owner on Jun 10, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #574 from funkycoding/feature/optional-logerror
added specific ApplicationInsightsLoggerOptions to configure logging
- Loading branch information
Showing
5 changed files
with
61 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 21 additions & 3 deletions
24
...ApplicationInsights.AspNetCore/Logging/Implementation/ApplicationInsightsLoggerOptions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,31 @@ | ||
namespace Microsoft.ApplicationInsights.AspNetCore.Logging | ||
using Microsoft.ApplicationInsights.DataContracts; | ||
using Microsoft.Extensions.Logging; | ||
|
||
namespace Microsoft.ApplicationInsights.AspNetCore.Logging | ||
{ | ||
/// <summary> | ||
/// Options for configuration of <see cref="ApplicationInsightsLogger"/>. | ||
/// <see cref="ApplicationInsightsLoggerOptions"/> defines the custom behavior of the tracing information sent to Application Insights. | ||
/// </summary> | ||
public class ApplicationInsightsLoggerOptions | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="ApplicationInsightsLoggerOptions" /> class. | ||
/// Application Insights logger options can configure how <see cref="ILogger"/> behaves when sending telemetry. | ||
/// </summary> | ||
public ApplicationInsightsLoggerOptions() | ||
{ | ||
TrackExceptionsAsExceptionTelemetry = true; | ||
} | ||
|
||
/// <summary> | ||
/// Gets or sets a value whether to track exceptions as <see cref="ExceptionTelemetry"/>. | ||
/// </summary> | ||
public bool TrackExceptionsAsExceptionTelemetry | ||
{ get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets value indicating, whether EventId and EventName properties should be included in telemetry. | ||
/// </summary> | ||
public bool IncludeEventId { get; set; } | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters