Commit b02968d
committed
Observe Microsoft.Extensions.Logging.LogLevel.None
Before this commit:
`LogLevel.None` is converted to `LogEventLevel.Fatal` and events with a `None` level are logged as fatal.
After this commit:
`LogLevel.None` is observed and logs and events with a `None` level are ignored.
The `None` level is documented as such:
> Not used for writing log messages. Specifies that a logging category should not write any messages.
Note: this erroneous behaviour was seen in a real-world scenario:
1. `BuildOrgConnectUri CoreClass ()` is [logged as `TraceEventType.Start `][1]
2. `TraceEventType.Start` is [converted to `LogLevel.None`][2]
3. `LogLevel.None ` is [converted to `LogEventLevel.Fatal`][3]
As a result, `BuildOrgConnectUri CoreClass ()` is logged as fatal whereas it should have been ignored.
[1]: https://github.com/microsoft/PowerPlatform-DataverseServiceClient/blob/0.6.1/src/GeneralTools/DataverseClient/Client/ConnectionService.cs#L3207
[2]: https://github.com/microsoft/PowerPlatform-DataverseServiceClient/blob/0.6.1/src/GeneralTools/DataverseClient/Client/DataverseTraceLogger.cs#L675
[3]: https://github.com/serilog/serilog-extensions-logging/blob/dev/src/Serilog.Extensions.Logging/Extensions/Logging/LevelConvert.cs#L391 parent e25ed7d commit b02968d
File tree
2 files changed
+28
-1
lines changed- src/Serilog.Extensions.Logging/Extensions/Logging
- test/Serilog.Extensions.Logging.Tests
2 files changed
+28
-1
lines changedLines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
57 | 61 | | |
58 | 62 | | |
59 | 63 | | |
| |||
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| |||
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
68 | 85 | | |
69 | 86 | | |
70 | 87 | | |
71 | 88 | | |
72 | 89 | | |
73 | 90 | | |
74 | 91 | | |
| 92 | + | |
75 | 93 | | |
76 | 94 | | |
77 | 95 | | |
78 | 96 | | |
79 | 97 | | |
80 | 98 | | |
| 99 | + | |
81 | 100 | | |
82 | 101 | | |
83 | 102 | | |
84 | 103 | | |
85 | 104 | | |
86 | 105 | | |
| 106 | + | |
87 | 107 | | |
88 | 108 | | |
89 | 109 | | |
90 | 110 | | |
91 | 111 | | |
92 | 112 | | |
| 113 | + | |
93 | 114 | | |
94 | 115 | | |
95 | 116 | | |
96 | 117 | | |
97 | 118 | | |
98 | 119 | | |
| 120 | + | |
99 | 121 | | |
100 | 122 | | |
101 | 123 | | |
102 | 124 | | |
103 | 125 | | |
104 | 126 | | |
| 127 | + | |
105 | 128 | | |
106 | 129 | | |
107 | 130 | | |
| |||
0 commit comments