开发者

log4j FileAppender using FileDatePatternConverter

开发者 https://www.devze.com 2023-03-06 23:58 出处:网络
Trying to use a pattern for filename in config such as: <appender name=\"FileAppender\" class=\"org.apache.log4j.FileAppender\">

Trying to use a pattern for filename in config such as:

<appender name="FileAppender" class="org.apache.log4j.FileAppender">
  <param name="File" class="org.apache.log4j.pattern.FileDatePatternConverter" value="logs/App-%d{yyyy-MM-dd_HH-mm-ss}.log" />
  <layout开发者_Python百科 class="org.apache.log4j.PatternLayout">
    <param name="ConversionPattern" value="%-5p(%c{1}) %d{yyyy-MM-dd HH:mm:ss.SSS}: %m%n" />
  </layout>
</appender>

This does not what work. What is correct syntax?

0

精彩评论

暂无评论...
验证码 换一张
取 消