<PackageReference Include="Serilog.Sinks.File" Version="7.0.0" />

Serilog.FileLoggerConfigurationExtensions

public static class FileLoggerConfigurationExtensions
Extends LoggerConfiguration with methods to add file sinks.
public static LoggerConfiguration File(this LoggerSinkConfiguration sinkConfiguration, string path, LogEventLevel restrictedToMinimumLevel, string outputTemplate, IFormatProvider formatProvider, long? fileSizeLimitBytes, LoggingLevelSwitch levelSwitch, bool buffered, bool shared, TimeSpan? flushToDiskInterval)

Write log events to the specified file.

public static LoggerConfiguration File(this LoggerSinkConfiguration sinkConfiguration, ITextFormatter formatter, string path, LogEventLevel restrictedToMinimumLevel, long? fileSizeLimitBytes, LoggingLevelSwitch levelSwitch, bool buffered, bool shared, TimeSpan? flushToDiskInterval)

Write log events to the specified file.

public static LoggerConfiguration File(this LoggerSinkConfiguration sinkConfiguration, string path, LogEventLevel restrictedToMinimumLevel, string outputTemplate, IFormatProvider formatProvider, long? fileSizeLimitBytes, LoggingLevelSwitch levelSwitch, bool buffered, bool shared, TimeSpan? flushToDiskInterval, RollingInterval rollingInterval, bool rollOnFileSizeLimit, int? retainedFileCountLimit, Encoding encoding)

Write log events to the specified file.

public static LoggerConfiguration File(this LoggerSinkConfiguration sinkConfiguration, ITextFormatter formatter, string path, LogEventLevel restrictedToMinimumLevel, long? fileSizeLimitBytes, LoggingLevelSwitch levelSwitch, bool buffered, bool shared, TimeSpan? flushToDiskInterval, RollingInterval rollingInterval, bool rollOnFileSizeLimit, int? retainedFileCountLimit, Encoding encoding)

Write log events to the specified file.

public static LoggerConfiguration File(this LoggerSinkConfiguration sinkConfiguration, string path, LogEventLevel restrictedToMinimumLevel = 0, string outputTemplate = "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj}{NewLine}{Exception}", IFormatProvider formatProvider = null, long? fileSizeLimitBytes = 1073741824, LoggingLevelSwitch levelSwitch = null, bool buffered = false, bool shared = false, TimeSpan? flushToDiskInterval = default, RollingInterval rollingInterval = 0, bool rollOnFileSizeLimit = false, int? retainedFileCountLimit = 31, Encoding encoding = null, FileLifecycleHooks hooks = null, TimeSpan? retainedFileTimeLimit = default)

Write log events to the specified file.

public static LoggerConfiguration File(this LoggerSinkConfiguration sinkConfiguration, ITextFormatter formatter, string path, LogEventLevel restrictedToMinimumLevel = 0, long? fileSizeLimitBytes = 1073741824, LoggingLevelSwitch levelSwitch = null, bool buffered = false, bool shared = false, TimeSpan? flushToDiskInterval = default, RollingInterval rollingInterval = 0, bool rollOnFileSizeLimit = false, int? retainedFileCountLimit = 31, Encoding encoding = null, FileLifecycleHooks hooks = null, TimeSpan? retainedFileTimeLimit = default)

Write log events to the specified file.

public static LoggerConfiguration File(this LoggerAuditSinkConfiguration sinkConfiguration, string path, LogEventLevel restrictedToMinimumLevel, string outputTemplate, IFormatProvider formatProvider, LoggingLevelSwitch levelSwitch)

Write log events to the specified file.

public static LoggerConfiguration File(this LoggerAuditSinkConfiguration sinkConfiguration, ITextFormatter formatter, string path, LogEventLevel restrictedToMinimumLevel, LoggingLevelSwitch levelSwitch)

Write log events to the specified file.

public static LoggerConfiguration File(this LoggerAuditSinkConfiguration sinkConfiguration, string path, LogEventLevel restrictedToMinimumLevel = 0, string outputTemplate = "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj}{NewLine}{Exception}", IFormatProvider formatProvider = null, LoggingLevelSwitch levelSwitch = null, Encoding encoding = null, FileLifecycleHooks hooks = null)

Write audit log events to the specified file.

public static LoggerConfiguration File(this LoggerAuditSinkConfiguration sinkConfiguration, ITextFormatter formatter, string path, LogEventLevel restrictedToMinimumLevel = 0, LoggingLevelSwitch levelSwitch = null, Encoding encoding = null, FileLifecycleHooks hooks = null)

Write audit log events to the specified file.