Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Eric Sosman Newsgroups: comp.lang.java.programmer Subject: Re: email from catch or exception Date: Wed, 11 Dec 2013 21:09:17 -0500 Organization: A noiseless patient Spider Lines: 40 Message-ID: References: <625312cc-d71d-4a95-9b97-095fffe36599@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 12 Dec 2013 02:09:19 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="858a9d65d95f4ea4d355bd116aa2cdbf"; logging-data="4010"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18CLMcCEax8Z/Yvt8H/57mK" User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 In-Reply-To: <625312cc-d71d-4a95-9b97-095fffe36599@googlegroups.com> Cancel-Lock: sha1:Xm8nXv0264joy2eKkxO2FmPM8ZU= Xref: csiph.com comp.lang.java.programmer:26852 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