/webportal_config/prod/log4j_template.xml

http://alageospatialportal.googlecode.com/ · XML · 48 lines · 32 code · 4 blank · 12 comment · 0 complexity · 403fef7685f8bbdd01240d680dc772aa MD5 · raw file

  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
  3. <!--
  4. This is a template from which the log4j.xml file will be built.
  5. The variables: **SERVER_NAME** and **PORTAL_NAME** will be replaced
  6. at runtime by the hostname and portal_name key from portal.properties
  7. respectivly. The log4j.xml file will then be written and log4j will
  8. reload. This is the most effective way I could find of changing the
  9. ConversionPattern value, as using an MDC and variable substitution
  10. didn't work properly because different threads needed to change
  11. the portal name value
  12. -->
  13. <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
  14. <appender name="console" class="org.apache.log4j.ConsoleAppender">
  15. <param name="Target" value="System.out"/>
  16. <layout class="org.apache.log4j.PatternLayout">
  17. <param name="ConversionPattern" value="%d{ISO8601} %5p [%t] (%F:%L) **SERVER_NAME** **PORTAL_NAME** - %m%n"/>
  18. </layout>
  19. </appender>
  20. <appender name="email" class="org.apache.log4j.net.SMTPAppender">
  21. <param name="BufferSize" value="512" />
  22. <param name="SMTPHost" value="postoffice.utas.edu.au" />
  23. <param name="From" value="gjsw@utas.edu.au" />
  24. <param name="To" value="bjward@utas.edu.au" />
  25. <param name="Subject" value="[WEBPORTAL] Application message" />
  26. <layout class="org.apache.log4j.PatternLayout">
  27. <param name="ConversionPattern"
  28. value="[%d{ISO8601}] **SERVER_NAME** **PORTAL_NAME** %n%n%-5p%n%n%c%n%n%m%n%n" />
  29. </layout>
  30. <filter class="org.apache.log4j.varia.LevelRangeFilter">
  31. <param name="LevelMin" value="WARN"/>
  32. <param name="LevelMax" value="FATAL"/>
  33. </filter>
  34. </appender>
  35. <logger name="org.springframework">
  36. <level value="warn"/>
  37. </logger>
  38. <root>
  39. <priority value ="debug" />
  40. <appender-ref ref="console" />
  41. <!-- <appender-ref ref="email" /> -->
  42. </root>
  43. </log4j:configuration>