Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

    <!--
        For more configuration infromation and examples see the Apache
        Log4j website: http://logging.apache.org/log4j/
    -->
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
    debug="false">

    <!-- A time/date based rolling appender -->
    <appender name="WIREFILE" class="org.apache.log4j.DailyRollingFileAppender">
        <param name="File" value="target/test-data/jclouds-wire.log" />
        <param name="Append" value="true" />

        <!-- Rollover at midnight each day -->
        <param name="DatePattern" value="'.'yyyy-MM-dd" />

        <param name="Threshold" value="TRACE" />

        <layout class="org.apache.log4j.PatternLayout">
            <!-- The default pattern: Date Priority [Category] Message\n -->
            <param name="ConversionPattern" value="%d %-5p [%c] (%t) %m%n" />

            <!--
                The full pattern: Date MS Priority [Category]
                (Thread:NDC) Message\n <param name="ConversionPattern"
                value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
            -->
        </layout>
    </appender>

    <!-- A time/date based rolling appender -->
    <appender name="FILE" class="org.apache.log4j.DailyRollingFileAppender">
        <param name="File" value="target/test-data/jclouds.log" />
        <param name="Append" value="true" />

        <!-- Rollover at midnight each day -->
        <param name="DatePattern" value="'.'yyyy-MM-dd" />

        <param name="Threshold" value="TRACE" />

        <layout class="org.apache.log4j.PatternLayout">
            <!-- The default pattern: Date Priority [Category] Message\n -->
            <param name="ConversionPattern" value="%d %-5p [%c] (%t) %m%n" />

            <!--
                The full pattern: Date MS Priority [Category]
                (Thread:NDC) Message\n <param name="ConversionPattern"
                value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
            -->
        </layout>
    </appender>
    <!-- A time/date based rolling appender -->
    <appender name="LOADBALANCERFILE" class="org.apache.log4j.DailyRollingFileAppender">
        <param name="File" value="target/test-data/jclouds-loadbalancer.log" />
        <param name="Append" value="true" />
        <param name="DatePattern" value="'.'yyyy-MM-dd" />
        <param name="Threshold" value="TRACE" />
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d %-5p [%c] (%t) %m%n" />
        </layout>
    </appender>

    <!-- A time/date based rolling appender -->
    <appender name="COMPUTEFILE" class="org.apache.log4j.DailyRollingFileAppender">
        <param name="File" value="target/test-data/jclouds-compute.log" />
        <param name="Append" value="true" />

        <!-- Rollover at midnight each day -->
        <param name="DatePattern" value="'.'yyyy-MM-dd" />

        <param name="Threshold" value="TRACE" />

        <layout class="org.apache.log4j.PatternLayout">
            <!-- The default pattern: Date Priority [Category] Message\n -->
            <param name="ConversionPattern" value="%d %-5p [%c] (%t) %m%n" />

            <!--
                The full pattern: Date MS Priority [Category]
                (Thread:NDC) Message\n <param name="ConversionPattern"
                value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
            -->
        </layout>
    </appender>

    <appender name="ASYNCCOMPUTE" class="org.apache.log4j.AsyncAppender">
        <appender-ref ref="COMPUTEFILE" />
    </appender>

    <appender name="ASYNC" class="org.apache.log4j.AsyncAppender">
        <appender-ref ref="FILE" />
    </appender>

    <appender name="ASYNCWIRE" class="org.apache.log4j.AsyncAppender">
        <appender-ref ref="WIREFILE" />
    </appender>

    <appender name="ASYNCLOADBALANCER" class="org.apache.log4j.AsyncAppender">
        <appender-ref ref="LOADBALANCERFILE" />
    </appender>
    <!-- ================ -->
    <!-- Limit categories -->
    <!-- ================ -->

    <category name="org.jclouds">
        <priority value="DEBUG" />
        <appender-ref ref="ASYNC" />
    </category>

    <category name="jclouds.headers">
        <priority value="DEBUG" />
        <appender-ref ref="ASYNCWIRE" />
    </category>

    <category name="jclouds.wire">
        <priority value="DEBUG" />
        <appender-ref ref="ASYNCWIRE" />
    </category>
    <category name="jclouds.loadbalancer">
        <priority value="DEBUG" />
        <appender-ref ref="ASYNCLOADBALANCER" />
    </category>
    <category name="jclouds.compute">
        <priority value="TRACE" />
        <appender-ref ref="ASYNCCOMPUTE" />
    </category>
    <!-- ======================= -->
    <!-- Setup the Root category -->
    <!-- ======================= -->

    <root>
        <priority value="WARN" />
    </root>

</log4j:configuration>
New to GrepCode? Check out our FAQ X