Where is RegexFilter? #637
Unanswered
dwhitejazz
asked this question in
Q&A
Replies: 1 comment
-
While log4j 1.x and logback are very similar, log4j 2.x and logback are less so. However, this means that you cannot take a log4j 2.x and copy-and-paste it into logback. It should not be too hard to extend ch.qos.logback.core.filter.Filter to implement a RegEx filter. Logback uses a rather simple convention-based mechanism to define parameters for components such as Filters. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to add a RegexFilter to my logback.xml to use with ZooKeeper server logging. However, it appears that ch.qos.logback.core.filter.RegexFilter does not exist in any version of logback core or the GitHub source.
I tried using the RegexFilter from log4j (org.apache.logging.log4j.core.filter.RegexFilter) but this does not work when added as a filter class to logback.xml. An Interpreter class complains that it cannot find path configurations for attributes "onMatch", "onMismatch", and "regex" even though I have defined them.
Therefore, why is RegexFilter missing? Can I use the log4j class instead and if so how do I configure it in logback.xml? If I need to write my own RegexFilter please advise me on the steps (i.e. what class to inherit, methods to implement, etc.)
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions