Let's say you want to monitor multiple applications and based on certain log events automatically trigger some mechanism - say send an email to application admin or may be start a server which went down etc etc. The easiest way to make this event driven monitoring setup, I think, is to redirect application log entries to JMS destinations instead of a logfile. Then have monitoring application subscribe to the JMS destination.
This is straightforward in log4j. Simply specify appender as JMSAppender. Below is sample configuration which is for a JMS destination of type Topic and ActiveMQ as JMS broker but this can be used for any JMS broker, all you need is client jar for it and find value of InitialContextFactoryName for it.
Once the application is restarted its logs will start going to the specified JMS destination. Here is a sample log entry as it shows up on my HermesJMS.
This is straightforward in log4j. Simply specify appender as JMSAppender. Below is sample configuration which is for a JMS destination of type Topic and ActiveMQ as JMS broker but this can be used for any JMS broker, all you need is client jar for it and find value of InitialContextFactoryName for it.
Once the application is restarted its logs will start going to the specified JMS destination. Here is a sample log entry as it shows up on my HermesJMS.