lqbweb
lqbweb

Reputation: 1708

log4j2 archive every week, rotate every startup?

I am trying to figure out how to simply rename the active log file on every startup, and archive all the rotated files once a week.

I am forced to specify the "filePattern" at the RollingFile appender declaration, instead of at the policy. Do this make sense?

Upvotes: 1

Views: 899

Answers (1)

lqbweb
lqbweb

Reputation: 1708

I ended up doing my own implementation of a DeleteAction, and attaching it to a DefaultRolloverStrategy, so that it is zipping everything before deleting. You can find the sourcecode at:

https://github.com/lqbweb/log4j2-ZipDelete

Upvotes: 2

Related Questions