<?xml version="1.0" encoding="UTF-8"?>
<ae:configurations xmlns:ae="http://agavi.org/agavi/config/global/envelope/1.0" xmlns="http://agavi.org/agavi/config/parts/logging/1.0">
    <ae:configuration>

        <loggers default="icinga-web">
        
            <!--
                Write a complete history to filesystem
            -->
            <logger name="icinga-web" class="AgaviLogger" level="AgaviLogger::ALL ^ AgaviLogger::DEBUG ^ AgaviLogger::INFO">
                <appenders>
                    <appender>UniversalLogfileAppender</appender>
                </appenders>
            </logger>
            
            <!-- 
                Auth specific logging
            --> 
            <logger name="icinga-debug" class="AgaviLogger" level="AgaviLogger::ALL ">
                <appenders>
                    <appender>DebugLogfileAppender</appender>
                </appenders>
            </logger>
            
            <!--
                Database log
            -->
            <logger name="appkit-database" class="AgaviLogger" level="AgaviLogger::ALL ^ AgaviLogger::DEBUG ^ AgaviLogger::INFO">
                <appenders>
                    <appender>AppKitDoctrineLogAppender</appender>
                </appenders>
            </logger>

        </loggers>
        
        <appenders>
            <!--
                AppKit database log appender. 
                * Using doctrine to write away entries
            -->
            <appender name="AppKitDoctrineLogAppender" class="AppKitDoctrineLoggerAppender" layout="PassThru" />
            
            <!--
                Agavi appender to dump into filesystem
                * Log files are rotated in a 7 day (AgaviRotatingFileLoggerAppender default) cycle
                * Use 'cycle' parameter to alter the cycle.
            -->
            <appender name="UniversalLogfileAppender" class="AgaviRotatingFileLoggerAppender" layout="ApacheStyle">
                <ae:parameters>
                    <ae:parameter name="dir">@web_log_dir@/</ae:parameter>
                    <ae:parameter name="prefix">icinga-web-</ae:parameter>
                </ae:parameters>
            </appender>
            
            <appender name="DebugLogfileAppender" class="AgaviRotatingFileLoggerAppender" layout="ApacheStyle">
                <ae:parameters>
                    <ae:parameter name="dir">@web_log_dir@/</ae:parameter>
                    <ae:parameter name="prefix">debug-</ae:parameter>
                </ae:parameters>
            </appender>
            
            <appender name="StdErrorAppender" class="AgaviStderrLoggerAppender" layout="DateTimeLayout" />
        </appenders>
        
        <layouts>
            <!-- Agavi's log format -->
            <layout name="DateTimeLayout" class="AgaviTimestampLoggerLayout" />

            <!-- Plain text without any formattings -->
            <layout name="PassThru" class="AgaviPassthruLoggerLayout" />

            <!-- AppKit Apache style, with timestamps and named loglevel -->
            <layout name="ApacheStyle" class="AppKitApacheLoggerFormat" />
        </layouts>
    </ae:configuration>
    
    <!--  Try include the overwriting file -->
    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="@web_conf_dir@/logging.xml#xmlns(ae=http://agavi.org/agavi/config/global/envelope/1.0)xpointer(ae:configurations/node())">
            <xi:fallback></xi:fallback>
    </xi:include>
</ae:configurations>
