Search Results for

    Show / Hide Table of Contents
    View Source

    Class ProfilingLogger

    Provides logging and profiling services.

    Inheritance
    object
    Namespace: Umbraco.Cms.Core.Logging
    Assembly: Umbraco.Core.dll
    Syntax
    public sealed class ProfilingLogger : IProfilingLogger

    Constructors

    View Source

    ProfilingLogger(ILogger, IProfiler)

    Initializes a new instance of the ProfilingLogger class.

    Declaration
    public ProfilingLogger(ILogger logger, IProfiler profiler)
    Parameters
    Type Name Description
    ILogger logger
    IProfiler profiler
    View Source

    ProfilingLogger(ILogger<ProfilingLogger>, IProfiler)

    Initializes a new instance of the ProfilingLogger class.

    Declaration
    public ProfilingLogger(ILogger<ProfilingLogger> logger, IProfiler profiler)
    Parameters
    Type Name Description
    ILogger<ProfilingLogger> logger
    IProfiler profiler

    Properties

    View Source

    Logger

    Gets the underlying Microsoft.Extensions.Logging.ILogger implementation.

    Declaration
    public ILogger Logger { get; }
    Property Value
    Type Description
    ILogger
    View Source

    Profiler

    Gets the underlying IProfiler implementation.

    Declaration
    public IProfiler Profiler { get; }
    Property Value
    Type Description
    IProfiler

    Methods

    View Source

    DebugDuration(Type, string, string, string?, int, object[]?, object[]?, object[]?)

    Profiles an action and log as debug messages.

    Declaration
    public DisposableTimer? DebugDuration(Type loggerType, string startMessage, string completeMessage, string? failMessage = null, int thresholdMilliseconds = 0, object[]? startMessageArgs = null, object[]? endMessageArgs = null, object[]? failMessageArgs = null)
    Parameters
    Type Name Description
    Type loggerType

    The type to use as the logger category.

    string startMessage

    The message to log when the timer starts.

    string completeMessage

    The message to log when the timer ends successfully.

    string failMessage

    The message to log if the operation fails.

    int thresholdMilliseconds

    Minimum elapsed time in milliseconds before logging the end message.

    object[] startMessageArgs

    Arguments for the start message template.

    object[] endMessageArgs

    Arguments for the end message template.

    object[] failMessageArgs

    Arguments for the fail message template.

    Returns
    Type Description
    DisposableTimer

    A DisposableTimer that logs completion when disposed, or null if debug logging is disabled.

    View Source

    DebugDuration<T>(string, object[]?)

    Profiles an action and log as debug messages.

    Declaration
    public DisposableTimer? DebugDuration<T>(string startMessage, object[]? startMessageArgs = null)
    Parameters
    Type Name Description
    string startMessage

    The message to log when the timer starts.

    object[] startMessageArgs

    Arguments for the start message template.

    Returns
    Type Description
    DisposableTimer

    A DisposableTimer that logs completion when disposed, or null if debug logging is disabled.

    Type Parameters
    Name Description
    T

    The type to use as the logger category.

    View Source

    DebugDuration<T>(string, string, string?, int, object[]?, object[]?, object[]?)

    Profiles an action and log as debug messages.

    Declaration
    public DisposableTimer? DebugDuration<T>(string startMessage, string completeMessage, string? failMessage = null, int thresholdMilliseconds = 0, object[]? startMessageArgs = null, object[]? endMessageArgs = null, object[]? failMessageArgs = null)
    Parameters
    Type Name Description
    string startMessage

    The message to log when the timer starts.

    string completeMessage

    The message to log when the timer ends successfully.

    string failMessage

    The message to log if the operation fails.

    int thresholdMilliseconds

    Minimum elapsed time in milliseconds before logging the end message.

    object[] startMessageArgs

    Arguments for the start message template.

    object[] endMessageArgs

    Arguments for the end message template.

    object[] failMessageArgs

    Arguments for the fail message template.

    Returns
    Type Description
    DisposableTimer

    A DisposableTimer that logs completion when disposed, or null if debug logging is disabled.

    Type Parameters
    Name Description
    T

    The type to use as the logger category.

    View Source

    IsEnabled(LogLevel)

    Checks if the given log level is enabled.

    Declaration
    public bool IsEnabled(LogLevel level)
    Parameters
    Type Name Description
    LogLevel level

    The log level to check.

    Returns
    Type Description
    bool

    true if the log level is enabled; otherwise, false.

    View Source

    IsEnabled(LogLevel)

    Checks if the given logLevel is enabled.

    Declaration
    public bool IsEnabled(LogLevel logLevel)
    Parameters
    Type Name Description
    LogLevel logLevel

    Level to be checked.

    Returns
    Type Description
    bool

    true if enabled; otherwise, false.

    View Source

    LogCritical(Exception, string, params object[])

    Logs a critical message with an exception.

    Declaration
    public void LogCritical(Exception exception, string messageTemplate, params object[] propertyValues)
    Parameters
    Type Name Description
    Exception exception

    The exception to log.

    string messageTemplate

    The message template.

    object[] propertyValues

    The property values to substitute into the template.

    View Source

    LogCritical(string, params object[])

    Logs a critical message.

    Declaration
    public void LogCritical(string messageTemplate, params object[] propertyValues)
    Parameters
    Type Name Description
    string messageTemplate

    The message template.

    object[] propertyValues

    The property values to substitute into the template.

    View Source

    LogDebug(string, params object[])

    Logs a debug message.

    Declaration
    public void LogDebug(string messageTemplate, params object[] propertyValues)
    Parameters
    Type Name Description
    string messageTemplate

    The message template.

    object[] propertyValues

    The property values to substitute into the template.

    View Source

    LogError(Exception, string, params object[])

    Logs an error message with an exception.

    Declaration
    public void LogError(Exception exception, string messageTemplate, params object[] propertyValues)
    Parameters
    Type Name Description
    Exception exception

    The exception to log.

    string messageTemplate

    The message template.

    object[] propertyValues

    The property values to substitute into the template.

    View Source

    LogError(string, params object[])

    Logs an error message.

    Declaration
    public void LogError(string messageTemplate, params object[] propertyValues)
    Parameters
    Type Name Description
    string messageTemplate

    The message template.

    object[] propertyValues

    The property values to substitute into the template.

    View Source

    LogInformation(string, params object[])

    Logs an information message.

    Declaration
    public void LogInformation(string messageTemplate, params object[] propertyValues)
    Parameters
    Type Name Description
    string messageTemplate

    The message template.

    object[] propertyValues

    The property values to substitute into the template.

    View Source

    LogTrace(string, params object[])

    Logs a trace message.

    Declaration
    public void LogTrace(string messageTemplate, params object[] propertyValues)
    Parameters
    Type Name Description
    string messageTemplate

    The message template.

    object[] propertyValues

    The property values to substitute into the template.

    View Source

    LogWarning(Exception, string, params object[])

    Logs a warning message with an exception.

    Declaration
    public void LogWarning(Exception exception, string messageTemplate, params object[] propertyValues)
    Parameters
    Type Name Description
    Exception exception

    The exception to log.

    string messageTemplate

    The message template.

    object[] propertyValues

    The property values to substitute into the template.

    View Source

    LogWarning(string, params object[])

    Logs a warning message.

    Declaration
    public void LogWarning(string messageTemplate, params object[] propertyValues)
    Parameters
    Type Name Description
    string messageTemplate

    The message template.

    object[] propertyValues

    The property values to substitute into the template.

    View Source

    TraceDuration(Type, string, string, string?, object[]?, object[]?, object[]?)

    Profiles an action and log as information messages.

    Declaration
    public DisposableTimer TraceDuration(Type loggerType, string startMessage, string completeMessage, string? failMessage = null, object[]? startMessageArgs = null, object[]? endMessageArgs = null, object[]? failMessageArgs = null)
    Parameters
    Type Name Description
    Type loggerType

    The type to use as the logger category.

    string startMessage

    The message to log when the timer starts.

    string completeMessage

    The message to log when the timer ends successfully.

    string failMessage

    The message to log if the operation fails.

    object[] startMessageArgs

    Arguments for the start message template.

    object[] endMessageArgs

    Arguments for the end message template.

    object[] failMessageArgs

    Arguments for the fail message template.

    Returns
    Type Description
    DisposableTimer

    A DisposableTimer that logs completion when disposed.

    View Source

    TraceDuration<T>(string, object[]?)

    Profiles an action and log as information messages.

    Declaration
    public DisposableTimer TraceDuration<T>(string startMessage, object[]? startMessageArgs = null)
    Parameters
    Type Name Description
    string startMessage

    The message to log when the timer starts.

    object[] startMessageArgs

    Arguments for the start message template.

    Returns
    Type Description
    DisposableTimer

    A DisposableTimer that logs completion when disposed.

    Type Parameters
    Name Description
    T

    The type to use as the logger category.

    View Source

    TraceDuration<T>(string, string, string?, object[]?, object[]?, object[]?)

    Profiles an action and log as information messages.

    Declaration
    public DisposableTimer TraceDuration<T>(string startMessage, string completeMessage, string? failMessage = null, object[]? startMessageArgs = null, object[]? endMessageArgs = null, object[]? failMessageArgs = null)
    Parameters
    Type Name Description
    string startMessage

    The message to log when the timer starts.

    string completeMessage

    The message to log when the timer ends successfully.

    string failMessage

    The message to log if the operation fails.

    object[] startMessageArgs

    Arguments for the start message template.

    object[] endMessageArgs

    Arguments for the end message template.

    object[] failMessageArgs

    Arguments for the fail message template.

    Returns
    Type Description
    DisposableTimer

    A DisposableTimer that logs completion when disposed.

    Type Parameters
    Name Description
    T

    The type to use as the logger category.

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