I recently upgraded from 2.0 to 2.1 version of log4php.

I have a log4php.ini like this,
log4php.rootLogger=WARN, appender1, appender2, <myappender>

;; my appender
log4php.appender. myappender = LoggerAppenderFile
log4php.appender. myappender.file = /tmp/myappender.log
log4php.appender. myappender.layout = LoggerLayoutTTCC

in trace.php plugin class  for zend framework, my class looks something
like this where I am trying to add run-time filter to myappender.

                // create filter and add it to my appender.
                $regExFilter = new LoggerFilterStringMatch();
                $regExFilter->setAcceptOnMatch(true);
                $regExFilter->setStringToMatch($traceRx);
                $regExFilter->activateOptions();


                $myAppender = $this->_rootLogger->getAppender('myappender');
                $this->_rootLogger->debug("THIS IS AN APPENDER WITH
FILTER".print_r($myAppender, true));
                if ($myAppender !== null) {
                   $myAppender->clearFilters();
                   $myAppender->addFilter($regExFilter);
                        $this->_rootLogger->debug("THIS IS APPENDER WITH
FILTER".print_r($myAppender, true));

                }
And I still see that ALL events are being logged and filter does not work.

Any thoughts/comments/suggestions?

Thanks,
Manasi

On Fri, Dec 9, 2011 at 2:03 AM, Ivan Habunek <ivan.habu...@gmail.com> wrote:

> On 8 December 2011 00:16, Manasi Sahasrabudhe <sma...@gmail.com> wrote:
> > We already have bunch of configs set in ini so I was wondering if I could
> > use thats already in place.
>
> Sure, we'll keep supporting ini config files, but any new features
> that are added may not be configurable through ini.
>
> > Also, I am working on a regular expression filter for trace i was
> wondering
> > is there anything available already?
>
> This has been planned for some time, but nothing is available at the
> moment. If you wish to contribute the code, it would be most welcome.
>
> Regards,
> Ivan
>

Reply via email to