Search Results for

    Show / Hide Table of Contents
    View Source

    Class StaticApplicationLogging

    Provides static access to application logging functionality.

    Inheritance
    object
    Namespace: Umbraco.Cms.Core
    Assembly: Umbraco.Core.dll
    Syntax
    public static class StaticApplicationLogging
    Remarks

    This class provides a way to access logging before dependency injection is fully configured. It must be initialized with an Microsoft.Extensions.Logging.ILoggerFactory before use.

    Properties

    View Source

    Logger

    Gets a default logger instance for general logging purposes.

    Declaration
    public static ILogger<object> Logger { get; }
    Property Value
    Type Description
    ILogger<object>

    Methods

    View Source

    CreateLogger(Type)

    Creates a logger for the specified type.

    Declaration
    public static ILogger CreateLogger(Type type)
    Parameters
    Type Name Description
    Type type

    The type to create a logger for.

    Returns
    Type Description
    ILogger

    An Microsoft.Extensions.Logging.ILogger instance, or a null logger if not initialized.

    View Source

    CreateLogger<T>()

    Creates a logger for the specified type.

    Declaration
    public static ILogger<T> CreateLogger<T>()
    Returns
    Type Description
    ILogger<T>

    An Microsoft.Extensions.Logging.ILogger<TCategoryName> instance, or a null logger if not initialized.

    Type Parameters
    Name Description
    T

    The type to create a logger for.

    View Source

    Initialize(ILoggerFactory)

    Initializes the static logging with the specified logger factory.

    Declaration
    public static void Initialize(ILoggerFactory loggerFactory)
    Parameters
    Type Name Description
    ILoggerFactory loggerFactory

    The Microsoft.Extensions.Logging.ILoggerFactory to use for creating loggers.

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