Search Results for

    Show / Hide Table of Contents

    Class LogFilterBase

    Base class for all log filters

    Inheritance
    object
    LogFilterBase
    ExactMatchLogSourceFilter
    RegexLogMessageFilter
    RegexLogSourceFilter
    Implements
    INoSerializationVerificationNeeded
    IDeadLetterSuppression
    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 abstract class LogFilterBase : INoSerializationVerificationNeeded, IDeadLetterSuppression
    Remarks

    Worth noting: these run inside the Logging actors, so they're out of band from any high performance workloads already.

    In addition to this - all log filters will only run if the log level is enabled.

    i.e. if we're at INFO level and the filter is set to a lower level, i.e. filtering DEBUG logs, the filter won't even run.

    Properties

    | Edit this page View Source

    FilterType

    Which part of the log message this filter is evaluating?

    Declaration
    public abstract LogFilterType FilterType { get; }
    Property Value
    Type Description
    LogFilterType
    Remarks

    This actually has a performance implication - if we're filtering on the source, which is already fully "expanded" into its final string representation, we can try to fail fast on that without any additional allocations.

    If we're filtering on the message, we have to fully expand the log message first which involves allocations. Users on really tight performance budgets should be aware of this.

    Methods

    | Edit this page View Source

    ShouldKeepMessage(LogEvent, string?)

    Fast path designed to avoid allocating strings if we're filtering on the message content.

    Declaration
    public abstract LogFilterDecision ShouldKeepMessage(LogEvent content, string? expandedMessage = null)
    Parameters
    Type Name Description
    LogEvent content

    Usually the fully expanded message content.

    string expandedMessage

    The fully expanded message, optional.

    Returns
    Type Description
    LogFilterDecision

    Implements

    INoSerializationVerificationNeeded
    IDeadLetterSuppression

    Extension Methods

    ObjectExtensions.IsDefaultForType<T>(T)
    ObjectExtensions.AsOption<T>(T)
    Extensions.AsInstanceOf<T>(object)
    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