Skip to content

Commit 178f6df

Browse files
author
RandomBuffer
authored
Fix C# example for PushProperty.
Fix C# example for PushProperty.
1 parent 11ae421 commit 178f6df

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

+4-4
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)