Posted By

nialace on 03/29/11


Tagged

java log4j meibo


Versions (?)

log4j log


 / Published in: Java
 

  1. <appender name="AlainDebug" class="org.apache.log4j.RollingFileAppender">
  2. <param name="File" value="${userDir}/logs/alain_debug.txt"/>
  3. <param name="MaxBackupIndex" value="9"/>
  4. <param name="MaxFileSize" value="2MB"/>
  5. <param name="threshold" value="debug"/>
  6. <layout class="org.apache.log4j.PatternLayout">
  7. <param name="ConversionPattern" value="%d %-5p [%t] %c - %m%n"/>
  8. </layout>
  9. </appender>
  10.  
  11. ...
  12.  
  13. <logger name="alain.debug" additivity="true">
  14. <level value="debug"/>
  15. <appender-ref ref="AlainDebug"/>
  16. </logger>
  17.  
  18. var logClass = new Class("org.apache.log4j.Logger");
  19. var log = logClass.getLogger("alain.debug");
  20. log.debug(msg);

Report this snippet  

You need to login to post a comment.