A.5.1 Sample Configuration File

This topic contains a sample logging configuration file.

Make special note of the comments in the following sample as they contain constraints that relate to properties and logging.

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">

<Appenders>      

               
               <RollingFile name="@@CATAGORY@@" append="true" filePattern="@@PATH@@">
      <FileName>@@PATH@@</FileName>
      <PatternLayout>
        <Pattern>[%d{E  dd/M/yyyy hh:mm:ss}] [@@CATAGORY@@] [%5p] - %m%n</Pattern>
      </PatternLayout>
      <Policies>
        <SizeBasedTriggeringPolicy size="10000kb"/>
      </Policies>
       <DefaultRolloverStrategy max="20"/>
    </RollingFile>
               
                                             <Console name="stdout" target="SYSTEM_OUT">
            <PatternLayout>
                <pattern>
                    [%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n
                </pattern>>
            </PatternLayout>
        </Console>
               </Appenders>     
               
               <Loggers>
           <Logger name="@@CATAGORY@@" level="info" additivity="false">
                                                <AppenderRef ref="@@CATAGORY@@" level="trace"/>
                                                <AppenderRef ref="stdout" level="error"/>
           </Logger>
                                             

                                 
        <Root level="error">
            <AppenderRef ref="stdout"/>
        </Root>
    </Loggers>
<!--        <root>

                              <priority value="##PRIORITY##"></priority>
               </root> -->
</log4j:configuration>