I’d like to demonstrate GlassFish configuration settings that will cause GlassFish v2ur2 (aka SJAS 9.1_02) to to send alert emails on logging errors or warnings.
A trivial task for an application server that implements a plethora of standards and offers such a slick user interface, I thought.
But I was very much mistaken. Even after having struggled for more than a day, I was unable to identify self management configuration settings that would produce alert mails on any severe or warning entry being logged.
Eventually I succeeded by adopting back level configuration settings from SJAS 8.1 (see Managing and Monitoring Sun Java System Application Server 8.1 – Declarative Alerts at the very bottom). Syntax errors and a package name had to be fixed to get <alert-service> going. What works for me within my domain.xml looks similar to:
<thread-pools> <thread-pool .../> </thread-pools> <alert-service> <alert-subscription name="AlertSubscription1"> <listener-config listener-class-name="com.sun.appserv.management.alert.MailAlert" subscribe-listener-with="LogMBean, ServerStatusMonitor, HeapSizeMonitor"> <property name="recipients" value="firstname.lastname@example.org, email@example.com"/> <property name="fromAddress" value="firstname.lastname@example.org"/> <property name="subject" value="Alert From GlassFish Application Server"/> <property name="includeDiagnostics" value="true"/> <property name="mailSMTPHost" value="my.smarthost.company.com"/> </listener-config> <filter-config filter-class-name="com.sun.appserv.management.alert.MailFilter"> <property name="filterWarningMessages" value="false"/> </filter-config> </alert-subscription> </alert-service> <management-rules ...> </management-rules> </config> <!-- config model with name "server-config" ends --> </configs>
I still would like to know, how to set up mail alerts using self administration settings (e.g. What is the object name to listen for? How to properly install the “default” Custom MBeans with GlassFish PE)?