How to follow / monitor the JBoss log?
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- All versions
- Other product based on EAP
Issue
- Is there a way to get the JBoss log during the deploy of an application using Linux terminal?
- How can JBoss log be monitored?
- How to follow the JBoss log?
- Is there a shell script that help me alert when something goes wrong on JBoss?
Resolution
To monitor the log file (e.g. server.log) you can use the tail -f command in this case Linux / Cygwin. It is real-time reading the log and with Ctrl + C command you can close the tail -f command and not lose any of your data (you can open it again with any text editor).
If you want to show the end of file on the screen until the condition is met and then return to the prompt, you can accomplish with the following script:
tail -f path/jboss-eap-6.0/standalone/log/server.log | while read line; do
echo $line | tee /dev/tty | grep -q message && echo '!!!Problem!!!' && break;
done
Note: path/jboss-eap-6.0/standalone/log/server.log represents the way to the server.log your server and it can be any log file .
You can take part tee / dev / tty | if you want the script do not show nothing on the screen.
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.
Comments