Reputation: 4137
Today I learnt about the existence of log4j filters, and how I can set them in configuration file.
I have an Appender serving all the classes under a given package.
For one of these classes I would like to set a log4j filter which I will develop that will be based on StringMatchFilter (it will extend it).
For all the other classes I do not want to use this filter.
How can this be obtained?
Upvotes: 1
Views: 2306
Reputation: 4137
I managed to dig a bit, and look at what might be the solution (still need to verify):
A. Obtain the Logger object
B. Call the getAppender
method
C. For the obtained Appender, call addFilter
Upvotes: 2