Skip to content

Commit c2c12d9

Browse files
PowerzIvan Gavryliuk
authored andcommitted
Exceptions and events should have LogLevel along with other properties (#89)
* 1. Exceptions and events should have LogLevel along with other properties. 2. Method parameters were never used, so removed as pointless. 3. The private method (ForwardPropertiesToTelemetryProperties) went to the bottom. * Revert "1. Exceptions and events should have LogLevel along with other properties. 2. Method parameters were never used, so removed as pointless. 3. The private method (ForwardPropertiesToTelemetryProperties) went to the bottom." This reverts commit c8a9fc6 * Exceptions and events should contain LogLevel along with other properties as this is crucial data.
1 parent 4ef86e2 commit c2c12d9

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/Serilog.Sinks.ApplicationInsights/ExtensionMethods/LogEventExtensions.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
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.
@@ -58,9 +58,9 @@ public static class LogEventExtensions
5858
public static void ForwardPropertiesToTelemetryProperties(this LogEvent logEvent,
5959
ISupportProperties telemetryProperties,
6060
IFormatProvider formatProvider,
61-
bool includeLogLevel = false,
61+
bool includeLogLevel = true,
6262
bool includeRenderedMessage = true,
63-
bool includeMessageTemplate = false)
63+
bool includeMessageTemplate = true)
6464
{
6565
if (logEvent == null) throw new ArgumentNullException(nameof(logEvent));
6666
if (telemetryProperties == null) throw new ArgumentNullException(nameof(telemetryProperties));
@@ -103,9 +103,9 @@ public static void ForwardPropertiesToTelemetryProperties(this LogEvent logEvent
103103
public static ExceptionTelemetry ToDefaultExceptionTelemetry(
104104
this LogEvent logEvent,
105105
IFormatProvider formatProvider,
106-
bool includeLogLevelAsProperty = false,
106+
bool includeLogLevelAsProperty = true,
107107
bool includeRenderedMessageAsProperty = true,
108-
bool includeMessageTemplateAsProperty = false)
108+
bool includeMessageTemplateAsProperty = true)
109109
{
110110
if (logEvent == null) throw new ArgumentNullException(nameof(logEvent));
111111
if (logEvent.Exception == null) throw new ArgumentException("Must have an Exception", nameof(logEvent));
@@ -146,9 +146,9 @@ public static ExceptionTelemetry ToDefaultExceptionTelemetry(
146146
public static EventTelemetry ToDefaultEventTelemetry(
147147
this LogEvent logEvent,
148148
IFormatProvider formatProvider,
149-
bool includeLogLevelAsProperty = false,
149+
bool includeLogLevelAsProperty = true,
150150
bool includeRenderedMessageAsProperty = true,
151-
bool includeMessageTemplateAsProperty = false)
151+
bool includeMessageTemplateAsProperty = true)
152152
{
153153
if (logEvent == null) throw new ArgumentNullException(nameof(logEvent));
154154

0 commit comments

Comments
 (0)