An example for some realy simple Log4.xml


/ Published in: Java
Save to your folder(s)

All you need todo in order to use this is just to add it to your path


Copy this code and paste it in your HTML
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
  3.  
  4. <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
  5.  
  6. <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
  7. <layout class="org.apache.log4j.PatternLayout">
  8. <param name="ConversionPattern" value="%p - %C{1}.%M(%L) | %m%n"/>
  9. </layout>
  10. </appender>
  11.  
  12. <appender name="ERRORS_FILE" class="org.apache.log4j.FileAppender">
  13. <param name="File" value="errors.log"/>
  14. <param name="Append" value="false"/>
  15. <layout class="org.apache.log4j.PatternLayout">
  16. <param name="ConversionPattern" value="%p - %C{1}.%M(%L) | %m%n"/>
  17. </layout>
  18. </appender>
  19.  
  20. <logger name="net.sf.hibernate">
  21. <level value="DEBUG"/>
  22. </logger>
  23.  
  24.  
  25. <logger name="org.springframework">
  26. <level value="WARN"/>
  27. </logger>
  28.  
  29.  
  30. <root>
  31. <level value="ERROR"/>
  32. <appender-ref ref="CONSOLE"/>
  33. </root>
  34. </log4j:configuration>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.