views:

445

answers:

2

Does anyone know of a system for automatic error reporting in java? We have a server product that is installed on client servers. The idea is that our server would phone home with the details of an error to one of our servers, which then enters a bug in our bug tracker. Preferable, this would happen over http. It wouldn't happen for all exceptions, just the more serious and any that are not otherwise handled.

I'm trying to avoid rolling my own. We'll catch the exceptions ourselves, but I'm hoping this system would handle as much as possible between exception handler and the bug tracker back home.

+3  A: 

Not conventional, but maybe you could use Log4J appenders to do it.

The SocketAppender allows you to send an event to a remote a log server. You can also communicate via mail using SMTPAppender (a little tricky but easy to implement). I don't know if there is any other appender to communicate with the server via HTTP (you could even implement it if needed, I suppose it is pretty easy).

Lets see if other users at stackoverflow have a better idea.

Guido
I thought of that, but I was hoping for something more complete
sblundy
Actually, I've recently implemented an ExceptionLogger, which is an appender that saves the log into the database (along with NDC context) in case any exception was logged during the processing. Was only couples of hours of work. Instead of DB yours should be doing HTTP request.
Vladimir Dyuzhev
+1  A: 

Have a look at SNMP4J. There are quite a lot of system administration tools to aggregate SNMP infomation (ask your systems administrator), and the Simple Network Management Protocol is designed for monitoring.

If you only need errors to be mailed to you you can also build your own framework with JavaMail; it is not that complicated and the boiler plate code can be put outside your business logic.

Maybe your bug tracking systems allows Soap/XML messages; then Axis would be a good fit, although it comes with quite a few dependencies.

extraneon