zoukankan      html  css  js  c++  java
  • Config Log4J for Spring in WSAD

    In SpringFramework, for logging by Log4J subsystem,  we can config it with the file named log4j.properties and put it in the folder web-inf/class/ (If using WSAD, you should put it in JavaSource/. It will be deployed to web-inf/class.).
    The content of a log4j.properties file like this:

    log4j.rootCategory=INFO, stdout, logfile
    log4j.appender.stdout=org.apache.log4j.ConsoleAppender
    log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
    log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n

    log4j.appender.logfile=org.apache.log4j.RollingFileAppender
    log4j.appender.logfile.File=/home/trisberg/jakarta-tomcat-4.1.24/logs/springapp.log
    log4j.appender.logfile.MaxFileSize=512KB
    # Keep three backup files
    log4j.appender.logfile.MaxBackupIndex=3
    log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
    #Pattern to output : date priority [category] - <message>line_separator
    log4j.appender.logfile.layout.ConversionPattern=%d %p [%c] - <%m>%n

    The item “log4j.appender.logfile.file“ is the path.

  • 相关阅读:
    中国一些web service收藏
    DataSet 和 List<T> 相互 转换
    JS图表
    IIS DirectoryEntry
    JS弹框
    Remoting
    Del SVN Configuare File BAT
    Viewport3D对象转换成图片
    在WPF中进行碰撞检测
    Button自定义样式
  • 原文地址:https://www.cnblogs.com/Samuel/p/27414.html
Copyright © 2011-2022 走看看