Is there any way to configure log4php to output logs only for a given class?
Asked
Active
Viewed 269 times
1 Answers
0
yes, there are two ways.
One is already supported by Log4php. You can configure to only log a specific logger:
log4php.logger.com.foo.Myclass=WARN
The other one is more complicated. You can create your own Filter: http://logging.apache.org/log4php/docs/appender-filter.html
A filter is a class which extends Log4PHP LoggerFilter interface. An example how a filter is implemented can be found here:
Cheers, Christian

Christian
- 7,062
- 5
- 36
- 39