Skip to content

Configure Sinks

Khaos edited this page Apr 28, 2021 · 3 revisions

Sink

<Serilog>
  <Using>Serilog.Sinks.File</Using>
  <WriteTo Name="File">
    <Path>/logs/FileLog.log</Path>
    <RestrictedToMinimumLevel>Warning</RestrictedToMinimumLevel>
    <RollingInterval>Day</RollingInterval>
  </WriteTo>
</Serilog>

Nested Sink

<Serilog>
  <Using>Serilog.Sinks.File</Using>
  <MinimumLevel Default="Debug" />
  <WriteTo Name="Logger">
    <ConfigureLogger>
      <WriteTo Name="File">
        <Path>/logs/WarnLog.log</Path>
        <RestrictedToMinimumLevel>Warning</RestrictedToMinimumLevel>
      </WriteTo>
    </ConfigureLogger>
  </WriteTo>
</Serilog>
Clone this wiki locally