#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
<?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="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${symbol_escape}n -->
            <param name="ConversionPattern" value="%d %-5p [%c] (%t) %m%n" />

            <!--
                The full pattern: Date MS Priority [Category]
                (Thread:NDC) Message${symbol_escape}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>

    <!-- 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${symbol_dollar}{symbol_escape}n -->
            <param name="ConversionPattern" value="%d %-5p [%c] (%t) %m%n" />

            <!--
                The full pattern: Date MS Priority [Category] (Thread:NDC) Message${symbol_dollar}{symbol_escape}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${symbol_dollar}{symbol_escape}n -->
      			<param name="ConversionPattern" value="%d %-5p [%c] (%t) %m%n" />
      
      			<!--
      				The full pattern: Date MS Priority [Category] (Thread:NDC) Message${symbol_dollar}{symbol_escape}n
      				<param name="ConversionPattern" value="%d %-5r %-5p [%c] (%t:%x)
      				%m%n"/>
      			-->
    		</layout>
  	</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>	
    
  	<!-- ================ -->
  	<!-- 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.compute">
        <priority value="TRACE" />
        <appender-ref ref="ASYNCCOMPUTE" />
    </category>

    
    <!-- ======================= -->
  	<!-- Setup the Root category -->
  	<!-- ======================= -->

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

</log4j:configuration>
