I wanna to improve jmx-console and admin console. That is we can tail file log over web interface but no need to go into the server.
Assumes that we have an application run on jbossas, and file log (generate by logger) is locate at server. If we want to tail log, we must to go to server, cd, tail... so many operations. but if we can go to jmx-console, press "tail log" button (which we exposed in jmx-mbean before) then all log running right front of you.
Like this >>>
Can anybody show me how?
I only could write an standalone application to tail log (I use RandomAccessFile class to read log file). Can I embed this into jmx-console or admin-console?
Thanks in advance with any ideas
your post is for the admin-console in the right section
Admin-console is built on top of RHQ (http://rhq-project.org) and its jboss-as5 plugin. The plugin itself already allows to to log file parsing. So form how I understand it, you would need to a) define the logfile location in the plugin connection settings (may need some mods of the plugin) from the UI code and add a tab (like there already is in RHQ) that shows the logfile portion.
The other option (especially for jmx-console) is that you write an MBean, which fires a swing app like the Hsqldb Mbean does to allow you a console.
Thanks for your reply. Could you tell me more about the first option .
I just try second option (fire a swing app) but this way is only done with local access. When I call Mbean (which fire the swing app) remotely, an exception was :
"Caused by: java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it."
Similar above if I call HSQLDB MBean...
Because of my purpose is "tail log file remotely". So, could you so me how
Thanks so much!