PageRenderTime 8ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/webportal_config/dev/log4j_template.xml

http://alageospatialportal.googlecode.com/
XML | 76 lines | 59 code | 5 blank | 12 comment | 0 complexity | 5dfe31308ce873612a90894469d46dd8 MD5 | raw file
 1<?xml version="1.0" encoding="UTF-8" ?>
 2<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
 3<!--
 4This is a template from which the log4j.xml file will be built.
 5
 6The variables: **SERVER_NAME** and **PORTAL_NAME** will be replaced
 7at runtime by the hostname and portal_name key from portal.properties
 8respectivly.  The log4j.xml file will then be written and log4j will
 9reload.  This is the most effective way I could find of changing the
10ConversionPattern value, as using an MDC and variable substitution
11didn't work properly because different threads needed to change
12the portal name value
13-->
14<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
15
16
17    <appender name="console" class="org.apache.log4j.ConsoleAppender">
18        <param name="Target" value="System.out"/>
19        <layout class="org.apache.log4j.PatternLayout">
20            <param name="ConversionPattern" value="%d{ISO8601} %5p [%t] (%F:%L) **SERVER_NAME** **PORTAL_NAME** - %m%n"/>
21        </layout>
22    </appender>
23
24    <appender name="rollfile" class="org.apache.log4j.DailyRollingFileAppender">
25        <param name="DatePattern" value="'.'yyyy-MM-dd"/>
26        <param name="File" value="/Library/Tomcat/Home/logs/useractions.log"/>
27        <param name="Append" value="true"/>
28        <param name="Threshold" value="INFO"/>
29        <layout class="org.apache.log4j.PatternLayout">
30            <param name="ConversionPattern" value='"%d{ISO8601}", "%X{userip}", "%X{useremail}", "%X{processid}", "%X{sessionid}", "%X{actiontype}", "%X{lsid}", "%X{layers}", "%X{method}", "%X{params}", "%X{downloadfile}", "%m"%n'/>
31        </layout>
32        <filter class="org.apache.log4j.filter.MDCMatchFilter">
33            <param name="KeyToMatch" value="actionby"/>
34            <param name="ValueToMatch" value="user"/>
35            <param name="ExactMatch" value="true"/>
36        </filter>
37    </appender>
38
39    <appender name="email"  class="org.apache.log4j.net.SMTPAppender">
40        <param name="BufferSize" value="512" />
41        <param name="SMTPHost" value="postoffice.utas.edu.au" />
42        <param name="From" value="gjsw@utas.edu.au" />
43        <param name="To" value="bjward@utas.edu.au" />
44        <param name="Subject" value="[WEBPORTAL] Application message" />
45        <layout class="org.apache.log4j.PatternLayout">
46            <param name="ConversionPattern"
47                   value="[%d{ISO8601}] **SERVER_NAME** **PORTAL_NAME** %n%n%-5p%n%n%c%n%n%m%n%n" />
48        </layout>
49        <filter class="org.apache.log4j.varia.LevelRangeFilter">
50            <param name="LevelMin" value="WARN"/>
51            <param name="LevelMax" value="FATAL"/>
52        </filter>
53    </appender>
54    <logger name="org.springframework">
55        <level value="warn"/>
56    </logger>
57    <logger name="org.apache.commons.httpclient">
58        <level value="error"/>
59    </logger>
60    <logger name="httpclient.wire">
61        <level value="fatal"/>
62    </logger>
63    <logger name="httpclient.httpconnection">
64        <level value="fatal"/>
65    </logger>
66    <logger name="httpclient.httpmethodbase">
67        <level value="fatal"/>
68    </logger>    
69    <root> 
70        <priority value ="debug" />
71        <appender-ref ref="console" />
72        <appender-ref ref="rollfile" />
73        <!--  <appender-ref ref="email" /> -->
74    </root>
75
76</log4j:configuration>