I have a normal DEBUG level log for application. What I need is to additionally log all ERROR level events to separate error log. I am using configuration like this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<log4php:configuration xmlns:log4php="http://www.vxr.it/log4php/"
threshold="all" debug="false">
<appender name="memcache_debug" class="LoggerAppenderFile">
<param name="file" value="${LOGS}memcache_debug.log" />
<layout class="LoggerPatternLayout">
<param name="conversionPattern" value="%d [%t] %-5p %c %m
%n" />
</layout>
</appender>
<root>
<level value="debug" />
<appender_ref ref="memcache_debug" />
</root>
</log4php:configuration>
This configuration logs debug only. If I put error level logger first, then it will log only to general appender, but debug logger will not work. I would like to have them both working.
You could use a second appender like so: