Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0b2a9ab

Browse files
Merge pull request #364 from RandomBuffer/FixPushPropertyExample
Fix properties example to use LogContext
2 parents 11ae421 + 178f6df commit 0b2a9ab

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,12 +276,12 @@ using (logger.BeginScope(new Dictionary<string, object>
276276
}
277277
```
278278

279-
The code above results in the same outcome as if you would push properties in the **ILogger** in Serilog.
279+
The code above results in the same outcome as if you would push properties in the **LogContext** in Serilog. More details can be found in https://github.com/serilog/serilog/wiki/Enrichment#the-logcontext.
280280

281281
```csharp
282-
// Serilog ILogger
283-
using (logger.PushProperty("UserId", "svrooij"))
284-
using (logger.PushProperty("OperationType", "update"))
282+
// Serilog LogContext
283+
using (LogContext.PushProperty("UserId", "svrooij"))
284+
using (LogContext.PushProperty("OperationType", "update"))
285285
{
286286
// UserId and OperationType are set for all logging events in these brackets
287287
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /