How to add the date timestamp to log4j2 logfiles?

前端 未结 5 1937
无人及你
无人及你 2021-02-14 04:03

I want to create day dependent logfiles with log4j2:


<
5条回答
  •  既然无缘
    2021-02-14 04:45

    The pattern should not be given in the attribute "fileName" rather you have to specify the pattern in the attribute "filePattern" as like below.

    
    ...
    ...
    
    

    The "%i" is the counter that will be automatically incremented in rollover.

    Hope this will help you.

提交回复
热议问题