Hallo Thanks for your reply. I am using the current HEAD for log4cxx, and just now I found out that the stringmatchfilter works with the XML file whereas not with a log4j style config file (maybe I am not doing that right). I do want to use the logger, like in the example above, I want to use some sort of a wildcard that would let me enable logging for all those that match that criteria. For example:
Log4j.logger.foo.*.bar.*.mylogger = OFF or *.mylogger = OFF Would disable logging for Log4j.logger.foo.1.bar.2.mylogger or Log4j.logger.foo.4.bar.7.mylogger this.and.that.logger I am not even sure if log4cxx currently supports this? By looking at the code I did see that it goes through a map to find a match for the logger name specified. I would really appreciate any tips or suggestion on this. Thanks & Regards, Rakesh. On Mon, Oct 13, 2014 at 4:32 PM, Thorsten Schöning <tschoen...@am-soft.de> wrote: > 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 > > -- Regards, Rakesh Sehgal.