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 #668 from Microsoft/develop
Dev to master for 2.3.0-beta2
- Loading branch information
Showing
18 changed files
with
263 additions
and
461 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
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
31 changes: 31 additions & 0 deletions
31
...Microsoft.ApplicationInsights.AspNetCore/Implementation/ApplicationInsightsDebugLogger.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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
namespace Microsoft.ApplicationInsights.AspNetCore | ||
{ | ||
using System; | ||
using System.Diagnostics; | ||
using Extensions; | ||
using Microsoft.Extensions.Logging; | ||
using Microsoft.Extensions.Options; | ||
|
||
/// <summary> | ||
/// Class used to enable Application Insight loggers while debugging. | ||
/// </summary> | ||
internal class ApplicationInsightsDebugLogger | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="ApplicationInsightsDebugLogger"/> class. | ||
/// </summary> | ||
public ApplicationInsightsDebugLogger( | ||
IOptions<ApplicationInsightsServiceOptions> options, | ||
ILoggerFactory loggerFactory, | ||
IServiceProvider serviceProvider) | ||
{ | ||
// Add default logger factory for debug mode only if enabled and instrumentation key not set | ||
if (options.Value.EnableDebugLogger && string.IsNullOrEmpty(options.Value.InstrumentationKey)) | ||
{ | ||
// Do not use extension method here or it will disable debug logger we currently adding | ||
var enableDebugLogger = true; | ||
loggerFactory.AddApplicationInsights(serviceProvider, (s, level) => enableDebugLogger && Debugger.IsAttached, () => enableDebugLogger = false); | ||
} | ||
} | ||
} | ||
} |
87 changes: 0 additions & 87 deletions
87
...Microsoft.ApplicationInsights.AspNetCore/Implementation/ApplicationInsightsInitializer.cs
This file was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.