Re: email from catch or exception
On 12/11/2013 6:23 PM, RVic wrote:
On Wednesday, December 11, 2013 5:55:34 PM UTC-5, RVic wrote:
Is anyone aware of a public domain package that can email you on an error, include the stack trace or log, whenever an exception occurs? Thank you, RVic
Looking to send an email on exceptions that are caught, and a general one for those that are uncaught.
I dont mind if there are a ton of emails!
I honestly do not know how many exceptions are thrown each
second in a "typical" Java program. As I said in another post
I think you'd have to modify the JVM to find out -- or maybe
you could use something in java.lang.instrument, a package I've
never had occasion to unwrap. Perhaps you should loosen that
ribbon a bit before writing "I want ALL of them!" on your
Christmas list.
But even if it's only one per second, you'll get 86400 per
day. Can you read 86400 E-mails in one day? Can you find the
four "different" stack traces among those 86400? Remember: You
have ONE second to make up your mind about each of them, if you
don't want to fall behind! Less, if you're monitoring more than
one Java environment ... Try this experiment: Turn off all your
spam filters, and opt out of any that your ISP offers, and tell
us how smoothly you deal with the onslaught.
Another little matter: At a rate of >= 1 E-mail/second, many
mail servers will say "Spammer!" and refuse to cooperate. What
are the chances that any of the "interesting" E-mails will be
among those that get through before the boom is lowered?
If you're in a position to write `catch' blocks to separate
the "possibly interesting" from "certainly boring" exceptions,
java.util.logging.Handler has sufficient hooks to spew info to
an agent that will E-mail it. But ALL exceptions!? I can't think
of any way (even in principle) to do that with a stock JVM, and
I can't imagine that you'd get anything usable out of it.
--
Eric Sosman
esosman@comcast-dot-net.invalid