Reputation: 121
I have used SizeBasedTriggeringPolicy
in LOG4J, it splits the files based on the size. My question here is that I want to zip all the files within a date into single folder.
Example:
log_20160709_1.txt
log_20160709_2.txt
log_20160709.3.txt
all the above files have to zip into log_20160709.zip.
I am able to zip the individual files but I want all to be in single zip folder.
Please provide the suggestion for it.
Upvotes: 1
Views: 168
Reputation: 1235
Try this pattern
<param name="FileNamePattern" value="/wombat/foo.%d{yyyy-MM-hh}.gz"/>
Upvotes: 0
Reputation: 9946
You have couple of options to do that
Automatic file compression
TimeBasedRollingPolicy supports automatic file compression. This feature is enabled if the value of the FileNamePattern option ends with .gz or .zip.
Upvotes: 1