Reputation: 959
I need to copy the gz file after the gzip was done. What is the best way to do this?
Upvotes: 3
Views: 3405
Reputation: 39
You cannot extend in in log4j2, because apache have made it a final class in log4j2. In earlier version of log4j you could have easily extended and called the custom class by configuring the appender in the properties file(xml). Their migration steps also doesn't specify how to move this functionality to log4j2.
Upvotes: 3
Reputation: 36844
You could specify the target folder of the gz file in the filePattern
attribute of the RollingFile configuration. Maybe I'm oversimplifying but I should mention the simple option first.
An alternative is to create a custom plugin action that runs after the rollover. For inspiration look at the source for DeleteAction.
You can configure your plugin similar to how the built-in delete action is configured.
Upvotes: 3