Guten Tag Rakesh Sehgal, am Montag, 13. Oktober 2014 um 21:05 schrieben Sie:
> I am trying to get log4cxx to use ExpressionFilter or > StringMatchFilter or any other through a java based config file: [...] > I have tried using various combination of the above statements, but > nothing seems to work. Just wanted to confirm, Which version of log4cxx do you use? Did you try the current HEAD of trunk? I didn't ever use those filters myself, but there are some tests at least for stringmatchfilter available. > Log4j.logger.foo.1.bar.2.mylogger = OFF > or > MyClassname.cpp = OFF > > So, if the filter finds *mylogger* anywhere, it will not log those > message. Please let me know if there is any other way to achieve this. Your example is about loggers, not log messages. Why don't you just deactivate the loggers you want? Or do you really want to filter messages of any loggers using the same, special appender? The filter examples in the source like in andfilter.h are all about appenders and only make sense there. Depending on your exact use case, if filters don't work you may even try to use some special appenders and deactivate those in code depending on some condition. For that you could e.g. override "doOnChange" of some file watch dog objects. Self quote: > As with your(?) previous question some weeks ago, I would suggest > overriding XMLWatchdog::doOnChange in domconfigurator.cpp and > reset/clean the whole configuration on each iteration using > LogManager::resetConfiguration Mit freundlichen Grüßen, Thorsten Schöning -- Thorsten Schöning E-Mail:thorsten.schoen...@am-soft.de AM-SoFT IT-Systeme http://www.AM-SoFT.de/ Telefon...........05151- 9468- 55 Fax...............05151- 9468- 88 Mobil..............0178-8 9468- 04 AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow