W3CLoggerOptions Class

Definition

Options for the Microsoft.AspNetCore.HttpLogging.W3CLogger.

public sealed class W3CLoggerOptions
type W3CLoggerOptions = class
Public NotInheritable Class W3CLoggerOptions
Inheritance
W3CLoggerOptions

Constructors

W3CLoggerOptions()

Properties

AdditionalRequestHeaders

List of additional request header values to log.

Request headers can contain authentication tokens, or private information which may have regulatory concerns under GDPR and other laws. Arbitrary request headers should not be logged unless logs are secure and access controlled and the privacy impact assessed.

FileName

Gets or sets a string representing the prefix of the file name used to store the logging information. The current date plus a file number (in the format {YYYYMMDD.X} will be appended to the given value. Defaults to w3clog-.

FileSizeLimit

Gets or sets a strictly positive value representing the maximum log size in bytes or null for no limit. Once the log is full, no more messages will be appended. Defaults to 10MiB.

FlushInterval

Gets or sets the period after which logs will be flushed to the store. Defaults to 1 second.

LogDirectory

Gets or sets a string representing the directory where the log file will be written to. Defaults to ./logs/ relative to the app directory (ContentRoot). If a full path is given, that full path will be used. If a relative path is given, the full path will be that path relative to ContentRoot.

LoggingFields

Fields to log. Defaults to logging request and response properties and headers, plus date/time info and server name.

RetainedFileCountLimit

Gets or sets a strictly positive value representing the maximum retained file count. Defaults to 4. Must be between 1 and 10,000, inclusive.

Applies to