Skip to content

Configure MinimumLevel

Khaos edited this page Apr 28, 2021 · 5 revisions

Setting MinimumLevel

<Serilog>
  <MinimumLevel>Debug</MinimumLevel>
</Serilog>

or

<Serilog>
  <MinimumLevel Default="Debug" />
</Serilog>

Overriding

<Serilog>
  <MinimumLevel Default="Debug">
    <Override Source="Microsoft">Warning</Override>
    <Override Source="System">Warning</Override>
  </MinimumLevel>
</Serilog>

Controlled by switch

<Serilog>
  <LevelSwitches>
    <Switch Name="MySwitch">Information</Switch>
  </LevelSwitches>
  <MinimumLevel ControlledBy="MySwitch" />
</Serilog>

or

<Serilog>
  <LevelSwitches>
    <Switch Name="MySwitch" Level="Warning" />
  </LevelSwitches>
  <MinimumLevel Default="Debug">
    <Override Source="Microsoft" ControlledBy="MySwitch" />
  </MinimumLevel>
</Serilog>
Clone this wiki locally