Skip to content

Commit

Permalink
Add App Insights to Serilog
Browse files Browse the repository at this point in the history
  • Loading branch information
RehanSaeed committed Mar 29, 2019
1 parent 2fe306e commit 797e4fe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">
<!--#if (AuthoringMode)-->
<PropertyGroup>
<!-- Modify these constants to enable/disable a feature to debug the template. Note that this only affects the C#. -->
Expand Down Expand Up @@ -54,6 +54,7 @@
<PackageReference Include="Serilog.Exceptions" Version="5.0.0" />
<PackageReference Include="Serilog.Extensions.Hosting" Version="2.0.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="3.0.1" />
<PackageReference Include="Serilog.Sinks.ApplicationInsights" Version="2.5.2" Condition="'$(ApplicationInsights)' == 'true'" />
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
<PackageReference Include="Serilog.Sinks.Debug" Version="1.0.1" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@
"WithThreadId"
],
"WriteTo": [
//#if (ApplicationInsights)
{
"Name": "ApplicationInsightsTraces",
// The instrumentation key for Application Insights retrieved from Azure e.g. 11111111-2222-3333-4444-555555555555
"InstrumentationKey": "APPLICATION-INSIGHTS-INSTRUMENTATION-KEY",
"RestrictedToMinimumLevel": "Warning"
},
//#endif
{
"Name": "Console",
"Theme": "Code"
Expand Down

0 comments on commit 797e4fe

Please sign in to comment.