How to compress JBoss logs
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 4.x
- 5.x
- 6.x
- 7.x
Issue
- Can use apache-log4j-extra to compress the jboss log files (server.log and boot.log)?
- Log file compression of JBoss Logs
Resolution
-
JBoss EAP 4.x/5.x/6.x/7.0/7.1/7.2 does not currently have functionality to compress logs. This would need to be implemented outside of JBoss EAP.
For example, user can run this command in the $PROFILE/log directory to compress rotated server.logs.$ ls server.log.*|grep -v '\.zip$' |xargs -i zip -m {}.zip {} -
From JBoss EAP 7.3 onward, we can compress the server.log using following cli command by changing the Content from github.com is not included.suffix attribute. If the suffix attribute ends with
.gzor.zip, the file will be compressed on rotation./subsystem=logging/periodic-rotating-file-handler=FILE:write-attribute(name=suffix,value=".yyyy-MM-dd-HH.zip") -
For domain configurations, prefix the above command with a specific profile (e.g. /profile=your_profile).
Root Cause
Content from issues.jboss.org is not included.Content from issues.jboss.org is not included.https://issues.jboss.org/browse/LOGMGR-30
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.