JBoss console.log

Latest response


JBoss EAP 6.0.1.GA
Red Hat 6.5
Standalone and domain installations

Can not rotate the file console.log without restarting JBoss

I am using JBoss EAP 6.0.1.GA on Red Hat and I would like to be able to manage the files console.log within a professional and sustainable way so that they do not fill up the whole disk.
Our installation writes the console.log files to: /var/log/jboss-as/console.log

A restart of the JBoss application initiates a new console.log file and creates an old copy with a date extension, called: /var/log/jboss-as/standalone/server.log.YYYY-MM-DD

We can deal with the other JBoss log files using something like: rotate-size value="2048"
However we can not rotate the console.log log file.

I have searched the web and these pages (the search on here is not very good) but I can not find any solutions for console.log. I can find lots of questions on the web but not any solutions.

Similar unanswered questions are here:

Some answers mention using the file log4j.xml but we do not have that file within this installation.

I have also looked at the JBoss documentation and a couple of books.
The JBoss documentation does not reference the file.

We need to be able to manage the file /var/log/jboss-as/console.log and I was hopping or really expecting that the product should really be able to to manage it itself with configuration.
It is an enterprise product after all.

Does anyone have an idea what we can do ?

Thank you.


Did you search our KCS [1] ?

[1] https://access.redhat.com/solutions/41242

Hi Mustafa Thank you for your reply. Yes I have seen that page thank you.

The mentioned "solution" specified within the reference https://access.redhat.com/solutions/41242 is either to restart the JBoss service or use an unsupported third party product.

Neither are "solutions" for a production environment that is available 24x7 under a support contract.

The question remains outstanding.

Additional information:

It does on initial inspection seem possible to use the logrotate process to rotate the JBoss log file console.log However, you will find that while the log file rotation works very well and the original file does indeed get truncated to zero bytes, JBoss continues to write to the log file from the point where it left off. This results in the truncated file that was zero bytes then reverting back to the original size with data writes then continuing from that point on wards. Thus, logrotate does indeed work but will not offer the solution that you will be looking for.

Reference: http://serverfault.com/questions/221337/logrotate-successful-original-file-goes-back-to-original-size

The best way of doing this is using the OS utilities that are available like cronlog or logrotate. If you're running on RHEL and have a support subscription for it then I'd suggest raising a support case to get the file size issue looked in to. I'm not sure I fully understand why it doesn't offer the solution you're looking for but I'm sure the platform support folks will be able to help.

Thanks yes. I will log a call.

Any recent updates based on Support call?