Search Results for

    Show / Hide Table of Contents

    Class Logging

    This class provides the functionality for creating logger instances and helpers for converting to/from LogLevel values.

    Inheritance
    object
    Logging
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Akka.Event
    Assembly: Akka.dll
    Syntax
    public static class Logging

    Methods

    | Edit this page View Source

    ClassFor(LogLevel)

    Retrieves the log event class associated with the specified log level.

    Declaration
    public static Type ClassFor(this LogLevel logLevel)
    Parameters
    Type Name Description
    LogLevel logLevel

    The log level used to lookup the associated class.

    Returns
    Type Description
    Type

    The log event class associated with the specified log level.

    Exceptions
    Type Condition
    ArgumentException

    The exception is thrown if the given logLevel is unknown.

    | Edit this page View Source

    GetLogger(ActorSystem, object, ILogMessageFormatter)

    Creates a new logging adapter using the specified system's event stream.

    Declaration
    public static ILoggingAdapter GetLogger(ActorSystem system, object logSourceObj, ILogMessageFormatter logMessageFormatter = null)
    Parameters
    Type Name Description
    ActorSystem system

    The system used to configure the logging adapter.

    object logSourceObj

    The source that produces the log events.

    ILogMessageFormatter logMessageFormatter

    The formatter used to format log messages.

    Returns
    Type Description
    ILoggingAdapter

    The newly created logging adapter.

    | Edit this page View Source

    GetLogger(IActorContext, ILogMessageFormatter)

    Creates a new logging adapter using the specified context's event stream.

    Declaration
    public static ILoggingAdapter GetLogger(this IActorContext context, ILogMessageFormatter logMessageFormatter = null)
    Parameters
    Type Name Description
    IActorContext context

    The context used to configure the logging adapter.

    ILogMessageFormatter logMessageFormatter

    The formatter used to format log messages.

    Returns
    Type Description
    ILoggingAdapter

    The newly created logging adapter.

    | Edit this page View Source

    GetLogger(LoggingBus, object, ILogMessageFormatter)

    Creates a new logging adapter that writes to the specified logging bus.

    Declaration
    public static ILoggingAdapter GetLogger(LoggingBus loggingBus, object logSourceObj, ILogMessageFormatter logMessageFormatter = null)
    Parameters
    Type Name Description
    LoggingBus loggingBus

    The bus on which this logger writes.

    object logSourceObj

    The source that produces the log events.

    ILogMessageFormatter logMessageFormatter

    The formatter used to format log messages.

    Returns
    Type Description
    ILoggingAdapter

    The newly created logging adapter.

    | Edit this page View Source

    LogLevelFor(string)

    Retrieves the log level from the specified string.

    Declaration
    public static LogLevel LogLevelFor(string logLevel)
    Parameters
    Type Name Description
    string logLevel

    The string representation of the log level to lookup.

    Returns
    Type Description
    LogLevel

    The log level that matches the specified string.

    Exceptions
    Type Condition
    ArgumentException

    The exception is thrown if the given logLevel is unknown.

    | Edit this page View Source

    LogLevelFor<T>()

    Retrieves the log level associated with the specified T.

    Declaration
    public static LogLevel LogLevelFor<T>() where T : LogEvent
    Returns
    Type Description
    LogLevel

    The log level associated with the specified LogEvent type.

    Type Parameters
    Name Description
    T

    The type of the log event.

    Exceptions
    Type Condition
    ArgumentException

    The exception is thrown if the given T is unknown.

    | Edit this page View Source

    SimpleName(object)

    Returns a "safe" LogSource name for the provided object's type.

    Declaration
    public static string SimpleName(object o)
    Parameters
    Type Name Description
    object o
    Returns
    Type Description
    string

    The simple name of the given object's Type.

    | Edit this page View Source

    SimpleName(Type)

    Returns a "safe" LogSource for the provided type.

    Declaration
    public static string SimpleName(Type t)
    Parameters
    Type Name Description
    Type t
    Returns
    Type Description
    string

    A usable simple LogSource name.

    | Edit this page View Source

    StringFor(LogLevel)

    Retrieves the log event class name associated with the specified log level.

    Declaration
    public static string StringFor(this LogLevel logLevel)
    Parameters
    Type Name Description
    LogLevel logLevel

    The log level used to lookup the associated class.

    Returns
    Type Description
    string

    The log event class name associated with the specified log level.

    Exceptions
    Type Condition
    ArgumentException

    The exception is thrown if the given logLevel is unknown.

    In this article
    • githubEdit this page
    • View Source
    Back to top
    Contribute
    • Project Chat
    • Discussion Forum
    • Source Code
    Support
    • Akka.NET Support Plans
    • Akka.NET Observability Tools
    • Akka.NET Training & Consulting
    Maintained By
    • Petabridge - The Akka.NET Company
    • Learn Akka.NET