自定义log4j.properties的加载位置

  • 自定义log4j.properties的加载位置
    jar方式运行:
    String configPathPrefix = "D:/conf/";
    PropertyConfigurator.configure(configPathPrefix + "log4j.properties");

一般的web方式:

     <context-param>
        <param-name>log4jConfigLocation</param-name>
        <param-value>
            WEB-INF/classes/log/log4j.properties
        </param-value>
    </context-param>

    <listener>
        <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
    </listener>

posted on 2019-05-13 00:04  愤怒的苹果ext  阅读(36)  评论(0编辑  收藏  举报

导航