-
Notifications
You must be signed in to change notification settings - Fork 0
Configure Enrichers & Properties
Khaos edited this page Apr 29, 2021
·
8 revisions
Enricher with zero arguments
<Serilog>
<Using>Serilog.Enrichers.Thread</Using>
<Enrich Name="WithThreadId" />
</Serilog>
Enricher with simple argument types
<Serilog>
<Enrich Name="WithProperty">
<Name>MyProperty</Name>
<Value>123</Value>
</Enrich>
</Serilog>
Enricher using static values as arguments. Pattern: <Namespace.Class>::<StaticProperty>, <Assembly>
<Serilog>
<Enrich Name="WithProperty">
<Name>Serilog.Enrichers.ThreadNameEnricher::ThreadNamePropertyName, Serilog.Enrichers.Thread</Name>
<Value>DefaultThread</Value>
</Enrich>
</Serilog>
<Serilog>
<Property Name="MyProperty" Value="Property-Value" />
</Serilog>
or
<Serilog>
<Property Name="MyProperty">Property-Value</Property>
</Serilog>