Can you deploy assemblies to the server and just hard-code your logic check 
using C#:

public class MyFilter : FilterSkeleton
{
    public override FilterDecision Decide(LoggingEvent loggingEvent)
    {
        /*
        If (Property1 = “111” && Property2 = “abc” ) ||
            (Property1 = ”111” && Property2 = “bbb”) ||
            (Property1 = ”222” && Property2 = “def”) ||
            (Property1 = ”333” && Property2 = “xyz”))
        Then
            Deny
        Else
            Accept
        */
    }
}

or must it by dynamic?




________________________________
From: Brian Carlson <[email protected]>
To: [email protected]
Sent: Mon, April 19, 2010 5:07:38 PM
Subject: Filters with AND/OR conditions.

  
I have 2 properties that I need to filter log messages based
upon.  I have setup an smtp appender for Error and Fatal log messages, but
a couple components didn’t implement logging properly and are logging
errors when they don’t exist.  That problem is being dealt
with.  So I’m trying to take care of those messages with filters. 
What is the best way to setup something like this:
 
If (Property1 = “111” && Property2 = “abc”
)  || 
    (Property1 = ”111” &&
Property2 = “bbb”) ||
    (Property1 = ”222” &&
Property2 = “def”) ||
    (Property1 = ”333” &&
Property2 = “xyz”))
Then
                Deny
Else
                Accept
 
 
Any help would be great.
 
Thanks,
Brian

Reply via email to