11// Copyright 2016 Serilog Contributors
2- //
2+ //
33// Licensed under the Apache License, Version 2.0 (the "License");
44// you may not use this file except in compliance with the License.
55// You may obtain a copy of the License at
6- //
6+ //
77// http://www.apache.org/licenses/LICENSE-2.0
8- //
8+ //
99// Unless required by applicable law or agreed to in writing, software
1010// distributed under the License is distributed on an "AS IS" BASIS,
1111// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -49,8 +49,7 @@ public static LoggerConfiguration ApplicationInsights(
4949 var client = new TelemetryClient ( telemetryConfiguration ?? TelemetryConfiguration . Active ) ;
5050#pragma warning restore CS0618
5151
52- return loggerConfiguration . Sink ( new ApplicationInsightsSink ( client , telemetryConverter ) ,
53- restrictedToMinimumLevel , levelSwitch ) ;
52+ return loggerConfiguration . ApplicationInsights ( client , telemetryConverter , restrictedToMinimumLevel , levelSwitch ) ;
5453 }
5554
5655 /// <summary>
@@ -72,8 +71,7 @@ public static LoggerConfiguration ApplicationInsights(
7271 var client = new TelemetryClient ( TelemetryConfiguration . Active ) ;
7372#pragma warning restore CS0618
7473
75- return loggerConfiguration . Sink ( new ApplicationInsightsSink ( client , telemetryConverter ) ,
76- restrictedToMinimumLevel , levelSwitch ) ;
74+ return loggerConfiguration . ApplicationInsights ( client , telemetryConverter , restrictedToMinimumLevel , levelSwitch ) ;
7775 }
7876
7977 /// <summary>
@@ -93,11 +91,9 @@ public static LoggerConfiguration ApplicationInsights(
9391 LogEventLevel restrictedToMinimumLevel = LevelAlias . Minimum ,
9492 LoggingLevelSwitch levelSwitch = null )
9593 {
96- return loggerConfiguration . Sink ( new ApplicationInsightsSink ( telemetryClient , telemetryConverter ) ,
97- restrictedToMinimumLevel , levelSwitch ) ;
94+ return loggerConfiguration . Sink ( new ApplicationInsightsSink ( telemetryClient , telemetryConverter ) , restrictedToMinimumLevel , levelSwitch ) ;
9895 }
9996
100-
10197 /// <summary>
10298 /// Adds a Serilog sink that writes <see cref="LogEvent">log events</see> to Microsoft Application Insights
10399 /// using a custom <see cref="ITelemetry" /> converter / constructor. Only use in rare cases when your application
@@ -125,7 +121,6 @@ public static LoggerConfiguration ApplicationInsights(
125121
126122 var client = new TelemetryClient ( config ) ;
127123
128- return loggerConfiguration . Sink ( new ApplicationInsightsSink ( client , telemetryConverter ) ,
129- restrictedToMinimumLevel , levelSwitch ) ;
124+ return loggerConfiguration . ApplicationInsights ( client , telemetryConverter , restrictedToMinimumLevel , levelSwitch ) ;
130125 }
131- }
126+ }
0 commit comments