Search Results for

    Show / Hide Table of Contents
    View Source

    Class UmbracoFileConfiguration

    Provides configuration settings for file-based logging in Umbraco using Serilog.

    Inheritance
    object
    Namespace: Umbraco.Cms.Infrastructure.Logging.Serilog
    Assembly: Umbraco.Infrastructure.dll
    Syntax
    public class UmbracoFileConfiguration

    Constructors

    View Source

    UmbracoFileConfiguration(IConfiguration)

    Initializes a new instance of the UmbracoFileConfiguration class using the specified configuration.

    Declaration
    public UmbracoFileConfiguration(IConfiguration configuration)
    Parameters
    Type Name Description
    IConfiguration configuration

    The Microsoft.Extensions.Configuration.IConfiguration instance used to configure the file settings.

    Properties

    View Source

    Enabled

    Gets or sets a value indicating whether file logging for Umbraco is enabled.

    Declaration
    public bool Enabled { get; set; }
    Property Value
    Type Description
    bool
    View Source

    FileSizeLimitBytes

    Gets or sets the maximum size, in bytes, that a log file can reach before it is rolled over.

    Declaration
    public long FileSizeLimitBytes { get; set; }
    Property Value
    Type Description
    long
    View Source

    FlushToDiskInterval

    Gets or sets the interval at which the log file buffer is flushed to disk. A shorter interval may reduce data loss in case of a crash, but can impact performance.

    Declaration
    public TimeSpan? FlushToDiskInterval { get; set; }
    Property Value
    Type Description
    TimeSpan?
    View Source

    RestrictedToMinimumLevel

    Gets or sets the minimum log event level allowed for logging.

    Declaration
    public LogEventLevel RestrictedToMinimumLevel { get; set; }
    Property Value
    Type Description
    LogEventLevel
    View Source

    RetainedFileCountLimit

    Gets or sets the maximum number of log files to retain.

    Declaration
    public int RetainedFileCountLimit { get; set; }
    Property Value
    Type Description
    int
    View Source

    RollOnFileSizeLimit

    Gets or sets a value indicating whether the log file should be rolled over when it reaches the configured file size limit.

    Declaration
    public bool RollOnFileSizeLimit { get; set; }
    Property Value
    Type Description
    bool
    View Source

    RollingInterval

    Gets or sets the interval that determines how frequently a new log file is created (for example, daily or hourly).

    Declaration
    public RollingInterval RollingInterval { get; set; }
    Property Value
    Type Description
    RollingInterval

    Methods

    View Source

    GetPath(string)

    Gets the full path for the log file based on the specified log directory.

    Declaration
    public string GetPath(string logDirectory)
    Parameters
    Type Name Description
    string logDirectory

    The directory where log files are stored.

    Returns
    Type Description
    string

    The full path to the log file.

    View Source

    GetPath(string, string, params string[])

    Constructs the full path for the log file based on the specified directory, file name format, and arguments.

    Declaration
    public string GetPath(string logDirectory, string fileNameFormat, params string[] fileNameArgs)
    Parameters
    Type Name Description
    string logDirectory

    The directory where the log file will be stored.

    string fileNameFormat

    The format string used to generate the log file name.

    string[] fileNameArgs

    Optional arguments to format the file name.

    Returns
    Type Description
    string

    The full path of the log file as a string.

    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX