aholub7x
aholub7x

Reputation: 818

Java: operator notifications

We need to monitor application stability. On of the part of this process is notifying operators (via xmpp, email, ...) about the potential issues in the business process.

That tools is more preferable for this kind of activity? Is it a good idea to use monitoring solutions like nagios or zabbix, or maybe some advanced java libraries exist for this?

Upvotes: 1

Views: 120

Answers (3)

WeMakeSoftware
WeMakeSoftware

Reputation: 9162

Log4J is useful for monitoring events (Ex: something has crashed, takes too long to complete, etc)

If you need realtime monitoring you should use JMX beans. This technology is designed for monitoring the activity of the applications. With this technology you could notify when some threshold is breached. (queue is filled by 75%)

There are several tools to connect to JMX enabled systems and to monitor them.

Upvotes: 0

As the program can discover issues itself, you could use the facilites available with a modern logging framework. You code against the slf4j API and use a logging backend configured to handle e.g. error messages special.

You then just have to have such a snippet in your code:

} catch (Exception e) {
   log.error("FooBar processing failed", e);
}

This generic approach at compile time can then do one or more of the following at runtime:

  • Log to a special file.
  • Send a Syslog message to another machine
  • Send an email to a predefined recipient with the error message and the stack trace.
  • Send an instant message to a Jabber account (which can then be forwarded to a MSN or a Yahoo account)
  • Write a row in a database

or you can write your own code doing what you need to have done.

Upvotes: 1

stacker
stacker

Reputation: 68992

You could use log4j SMTPAppender to send eMails to operators for selected error-level log - entries that require analization of an issue.

For log based monitoring you might want to check Chainsaw

Upvotes: 0

Related Questions