Configuring RollingFileAppender in log4j

前端 未结 8 1338
谎友^
谎友^ 2020-12-01 01:43

I\'m working on a set of web services and we\'d like to have a daily rotated log.

I\'m trying to get org.apache.log4j.rolling.RollingFileAppender from t

8条回答
  •  无人及你
    2020-12-01 02:25

    Regarding error: log4j:ERROR Element type "rollingPolicy" must be declared

    1. Use a log4j.jar version newer than log4j-1.2.14.jar, which has a log4j.dtd defining rollingPolicy.
    2. of course you also need apache-log4j-extras-1.1.jar
    3. Check if any other third party jars you are using perhaps have an older version of log4j.jar packed inside. If so, make sure your log4j.jar comes first in the order before the third party containing the older log4j.jar.

提交回复
热议问题