Reputation: 265
I'm developing an application with JBoss 7.1 where I'm using a periodic-rotating-file-handler tag for creating a history files of logs. What I want to do is compress the files in some format like .gz
I tried to to this:
<periodic-rotating-file-handler name="MY_LOG">
<filter>
<all>
<match pattern="TEXT"/>
</all>
</filter>
<formatter>
<pattern-formatter pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p [%c] (%t) %s%E%n"/>
</formatter>
<file relative-to="jboss.server.log.dir" path="server.log"/>
<suffix value="_yyyy-MM-dd.gz"/>
<append value="true"/>
</periodic-rotating-file-handler>
but I got this error:
Illegal pattern character 'g'
any idea how to compress with jboss 7.1?
Upvotes: 2
Views: 1873
Reputation: 17815
The suffix expects only a pattern that can be parsed by SimpleDateFormat
. There is no ability to compress the rolled log file from the handler itself.
Upvotes: 1