Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #12904

Re: Exception Handling

From Novice <novice@example..com>
Newsgroups comp.lang.java.programmer
Subject Re: Exception Handling
Date 2012-03-12 17:43 +0000
Organization Your Company
Message-ID <XnsA0148BB42FDABjpnasty@94.75.214.39> (permalink)
References (1 earlier) <jjh39f$crc$1@news.albasani.net> <XnsA01385245AD09jpnasty@94.75.214.39> <jjipli$np7$1@news.albasani.net> <XnsA013B63659242jpnasty@94.75.214.39> <yPa7r.13504$wf.12231@newsfe09.iad>

Show all headers | View raw


Arved Sandstrom <asandstrom3minus1@eastlink.ca> wrote in
news:yPa7r.13504$wf.12231@newsfe09.iad: 

> On 12-03-11 06:54 PM, Novice wrote:
>> Lew <noone@lewscanon.com> wrote in
>> news:jjipli$np7$1@news.albasani.net: 
>> 
> [ SNIP ]
> 
>>> We've discussed this before, remember?
>>>
>>> It's not expensive. When you're calling a logger statement for an
>>> error, the cost of the error SWAMPS the time in the logger. Think
>>> about it. 
>>>
>> I suppose I'm too easily swayed by other opinions. Arved, who seems
>> very knowledgeable, cited that article, which seemed to give it his
>> seal of approval. I don't know the author of the article but I tend
>> to assume he must be an expert to be asked to write about a Java
>> topic. The author cites people who he considers experts and the
>> upshot is that the advice seems to argue against putting positioning
>> information in the log unless its necessary (which it probably isn't
>> if the stacktrace is in the log). Now you make a persuasive argument
>> contradicting the article. I'm satisfied that you have serious
>> expertise in this area so I have no reason to dismiss your argument.
>> But why didn't the experts who wrote the article modify their remarks
>> accordingly? 
> [ SNIP ]
> 
> The article did have my "seal of approval". That's to say, I read the
> article, and agreed with most of it. Not 100 percent, but most of it.
> And I didn't see anything in it which would lead a person down the
> garden path. I recommend it because it's a useful read...but you
> shouldn't accept it as the gospel, just as you shouldn't accept
> "Effective Java" as the gospel either.
> 
Absolutely. Please understand that I didn't mean to imply that you gave 
your whole-hearted endorsement to every bit of it. I just meant that 
you'd suggested it in an approving manner, which suggested that it was 
basically sound, not necessarily perfect in every detail.

> Logging is also a somewhat subjective matter. That's why different
> opinions on different specifics. Ultimately TIMTOWTDI, to borrow a
> Perl motto.
I dabbled in Perl briefly some years ago but didn't know that acronym. 
But, as Lew likes to remind me, Google is my friend so now I know what it 
means ;-)

> What really counts is when the rubber meets the road, and
> the logs have to be _used_, did the ops support people get what they
> needed out of the logs, without too much anguish?
>
That makes perfect sense to me.
 
> You've heard different viewpoints - mine and others' - on including
> positional informational in logs. In the final analysis what matters
> is the sufficiency of information in the logs. Don't worry overmuch
> about logging performance until it's a problem; the whole point of
> having layouts in a properties file is that you can tweak them if
> necessary. I have a specific reason why I don't normally include
> certain positional information, except for error stacktraces, but
> someone else might have a good reason for why they do want this info.
> 
Speaking with my programmer hat on, I tend to find that the stacktrace 
meets most of my needs. I mostly use the class name, method name, and 
line numbers to see where the problem is and what the message is. And I 
don't tend to worry about performance until it starts to become an 
obvious problem either. But I always start feeling a bit anxious when 
people start talking about performance and wonder if I'm shooting myself 
(or my system) in the foot with the techniques I use. But, so far, that 
hasn't been a frequent problem. 

> One note: *never* assume that because somebody has an article in a
> blog or an Internet magazine or a dead tree magazine or even a
> scholarly journal that they are experts. Check the references. Check
> the style of the prose: are the conclusions backed up by
> understandable argument, or are they just "put out there"? Google for
> other articles on the same topic. 
> 
In all honesty, I had that in the back of my mind too. I don't really 
blindly assume that everything I read is written by an expert. I tend to 
give people the benefit of the doubt, especially in topics where I have 
minimal knowledge, but I know that some articles are just nonsense. But 
if a guy who knows his stuff (like you) recommends an article to me and 
it is in a journal that I haven't actually heard trashed by someone 
knowledgable, I tend to assume that knowledgable editors will have done a 
conscientious job of keeping out anything that is complete nonsense. But 
I realize that is hardly a bulletproof approach. So I do retain some 
basic skepticism about things I read ;-)

-- 
Novice

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Exception Handling Novice <novice@example..com> - 2012-03-11 01:51 +0000
  Re: Exception Handling Lew <noone@lewscanon.com> - 2012-03-10 18:39 -0800
    Re: Exception Handling Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-03-11 11:53 -0300
      Re: Exception Handling Lew <noone@lewscanon.com> - 2012-03-11 10:51 -0700
        Re: Exception Handling Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-03-11 16:35 -0300
    Re: Exception Handling Novice <novice@example..com> - 2012-03-11 17:05 +0000
      Re: Exception Handling Lew <noone@lewscanon.com> - 2012-03-11 10:53 -0700
        Re: Exception Handling Novice <novice@example..com> - 2012-03-11 20:36 +0000
      Re: Exception Handling Lew <noone@lewscanon.com> - 2012-03-11 11:07 -0700
        Re: Exception Handling Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-03-11 17:00 -0300
          Re: Exception Handling Novice <novice@example..com> - 2012-03-11 22:02 +0000
        Re: Exception Handling Arivald <NOSPAMarivald@interia.pl> - 2012-03-11 21:03 +0100
          Re: Exception Handling Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-03-11 18:31 -0300
        Re: Exception Handling Novice <novice@example..com> - 2012-03-11 21:54 +0000
          Re: Exception Handling Patricia Shanahan <pats@acm.org> - 2012-03-11 15:26 -0700
            Re: Exception Handling Novice <novice@example..com> - 2012-03-11 23:23 +0000
              Re: Exception Handling Lew <noone@lewscanon.com> - 2012-03-11 16:52 -0700
                Re: Exception Handling Novice <novice@example..com> - 2012-03-12 17:16 +0000
                Re: Exception Handling Lew <noone@lewscanon.com> - 2012-03-13 08:31 -0700
              Re: Exception Handling Patricia Shanahan <pats@acm.org> - 2012-03-11 17:51 -0700
                Re: Exception Handling Novice <novice@example..com> - 2012-03-12 17:26 +0000
            Re: Exception Handling Arne Vajhøj <arne@vajhoej.dk> - 2012-03-12 14:49 -0400
          Re: Exception Handling Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-03-11 20:46 -0300
            Re: Exception Handling Novice <novice@example..com> - 2012-03-12 17:43 +0000
      Re: Exception Handling Patricia Shanahan <pats@acm.org> - 2012-03-11 11:14 -0700
        Re: Exception Handling Novice <novice@example..com> - 2012-03-11 22:35 +0000
          Re: Exception Handling Lew <noone@lewscanon.com> - 2012-03-11 16:58 -0700
            Re: Exception Handling Novice <novice@example..com> - 2012-03-12 15:44 +0000
              Re: Exception Handling Gene Wirchenko <genew@ocis.net> - 2012-03-12 10:34 -0700
      Re: Exception Handling Arivald <NOSPAMarivald@interia.pl> - 2012-03-11 20:34 +0100
        Re: Exception Handling Novice <novice@example..com> - 2012-03-11 22:36 +0000
    Re: Exception Handling Arne Vajhøj <arne@vajhoej.dk> - 2012-03-12 14:41 -0400
  Re: Exception Handling Arne Vajhøj <arne@vajhoej.dk> - 2012-03-12 14:37 -0400
    Re: Exception Handling Novice <novice@example..com> - 2012-03-12 22:43 +0000
      Re: Exception Handling Lew <lewbloch@gmail.com> - 2012-03-12 16:11 -0700
      Re: Exception Handling Arivald <NOSPAMarivald@interia.pl> - 2012-03-13 00:54 +0100
        Re: Exception Handling Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-03-13 06:05 -0300

csiph-web