You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Nicola Ken Barozzi <ni...@apache.org> on 2002/09/05 15:23:36 UTC

[VOTE] Make errors caught only by Cocoon.java

I would really like to see the errors caught ONLY by Cocoon.java, and
logged there. It would reduce the problems we are having a LOT.

+1

Carsten Ziegeler wrote:
> Nicola Ken Barozzi wrote:
> 
> 
> 
>>>But there was no consensus on if we should log when the
>>
>>exception is thrown
>>
>>>or when it is catched and consumed (and not rethrown). I prever the last
>>>way and someone else prefered the first solution. So, it's still as it
>>>is and you get an exception logged more than once - blowing up the log.
>>
>>It should be logged when it is consumed, because you can never tell if
>>you catch a new exception or an already rethrown one.
>>
>>BTW, do we really need to log exceptions in the components?
>>
>>I would really like to see the errors caught ONLY by Cocoon.java, and
>>logged there. It would reduce the problems we are having a LOT.
>>
> 
> That's what I suggested years ago...


-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [VOTE] Make errors caught only by Cocoon.java

Posted by Marcus Crafter <cr...@fztig938.bank.dresdner.net>.
On Thu, Sep 05, 2002 at 04:10:49PM +0200, Carsten Ziegeler wrote:
> 
> Nicola Ken Barozzi wrote:
> > > 	
> > > 	if (getLogger().isDebugEnabled()) {
> > > 		getLogger().debug(.....);
> > > 	}
> > > 	
> > > 	to save logging un-logged text ?
> > 
> > We should *always* do it, it is common practice... when we remember to 
> > do it ;-)
> > 
> 
> And we vote several times on this - every time with the same agreement that
> we do it this way, but there had noone time to fix this in all places.
> So, as a new committer.... ;)

	*smile* :)

> Carsten
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
> 

-- 
        .....
     ,,$$$$$$$$$,      Marcus Crafter
    ;$'      '$$$$:    Computer Systems Engineer
    $:         $$$$:   ManageSoft GmbH
     $       o_)$$$:   82-84 Mainzer Landstrasse
     ;$,    _/\ &&:'   60327 Frankfurt Germany
       '     /( &&&
           \_&&&&'
          &&&&.
    &&&&&&&:

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


RE: [VOTE] Make errors caught only by Cocoon.java

Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Nicola Ken Barozzi wrote:
> > 	
> > 	if (getLogger().isDebugEnabled()) {
> > 		getLogger().debug(.....);
> > 	}
> > 	
> > 	to save logging un-logged text ?
> 
> We should *always* do it, it is common practice... when we remember to 
> do it ;-)
> 

And we vote several times on this - every time with the same agreement that
we do it this way, but there had noone time to fix this in all places.
So, as a new committer.... ;)

Carsten

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [VOTE] Make errors caught only by Cocoon.java

Posted by Nicola Ken Barozzi <ni...@apache.org>.
Marcus Crafter wrote:
> Hi All,
> 
> 	Hope all is well.
> 	
> 	+1 from me too, although with the example below, I'd use warn() or
> 	something appropriate to indicate that an exceptional situation
> 	has occured (unless that exception really was just for debugging).
> 	
> 	Shouldn't we also wrap our logging statements with tests before
> 	hand ?
> 	
> 	ie. instead of:
> 	
> 	getLogger().debug("some value " + value + ", some other value " + v);
> 	
> 	have:
> 	
> 	if (getLogger().isDebugEnabled()) {
> 		getLogger().debug(.....);
> 	}
> 	
> 	to save logging un-logged text ?

We should *always* do it, it is common practice... when we remember to 
do it ;-)

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [VOTE] Make errors caught only by Cocoon.java

Posted by Giacomo Pati <gi...@apache.org>.
On Thu, 5 Sep 2002, Marcus Crafter wrote:

> Hi All,
>
> 	Hope all is well.
>
> 	+1 from me too, although with the example below, I'd use warn() or
> 	something appropriate to indicate that an exceptional situation
> 	has occured (unless that exception really was just for debugging).
>
> 	Shouldn't we also wrap our logging statements with tests before
> 	hand ?
>
> 	ie. instead of:
>
> 	getLogger().debug("some value " + value + ", some other value " + v);
>
> 	have:
>
> 	if (getLogger().isDebugEnabled()) {
> 		getLogger().debug(.....);
> 	}

This should be normal practice since long ago. LogKit is fast but given
the amount of debug messages Cocoon produces we should use that
coding pattern everywhere.

Giacomo

>
> 	to save logging un-logged text ?
>
> 	Cheers,
>
> 	Marcus
>
> On Thu, Sep 05, 2002 at 03:51:12PM +0200, Carsten Ziegeler wrote:
> > OK, then +1
> >
> > Carsten
> >
> > > -----Original Message-----
> > > From: Nicola Ken Barozzi [mailto:nicolaken@apache.org]
> > > Sent: Thursday, September 05, 2002 3:36 PM
> > > To: cocoon-dev@xml.apache.org
> > > Subject: Re: [VOTE] Make errors caught only by Cocoon.java
> > >
> > >
> > >
> > > Carsten Ziegeler wrote:
> > > >
> > > >>-----Original Message-----
> > > >>From: Nicola Ken Barozzi [mailto:nicolaken@apache.org]
> > > >>Sent: Thursday, September 05, 2002 3:24 PM
> > > >>To: cocoon-dev@xml.apache.org
> > > >>Subject: [VOTE] Make errors caught only by Cocoon.java
> > > >>
> > > >>
> > > >>I would really like to see the errors caught ONLY by Cocoon.java, and
> > > >>logged there. It would reduce the problems we are having a LOT.
> > > >>
> > > >>+1
> > > >>
> > > >
> > > > I would like to extend this proposal a little bit by:
> > > >
> > > > "Exceptions are only logged when they are consumed (and not rethrown)".
> > > >
> > > > So, if I write
> > > > try {
> > > >    ...
> > > > } catch (Exception e) {
> > > >   // ignore this...
> > > > }
> > > >
> > > > this should be logged, perhaps not with level error, but debug.
> > >
> > > +1  Yes, that's it.
> > >
> > > --
> > > Nicola Ken Barozzi                   nicolaken@apache.org
> > >              - verba volant, scripta manent -
> > >     (discussions get forgotten, just code remains)
> > > ---------------------------------------------------------------------
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> > > For additional commands, email: cocoon-dev-help@xml.apache.org
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> > For additional commands, email: cocoon-dev-help@xml.apache.org
> >
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [VOTE] Make errors caught only by Cocoon.java

Posted by Marcus Crafter <cr...@fztig938.bank.dresdner.net>.
Hi All,

	Hope all is well.
	
	+1 from me too, although with the example below, I'd use warn() or
	something appropriate to indicate that an exceptional situation
	has occured (unless that exception really was just for debugging).
	
	Shouldn't we also wrap our logging statements with tests before
	hand ?
	
	ie. instead of:
	
	getLogger().debug("some value " + value + ", some other value " + v);
	
	have:
	
	if (getLogger().isDebugEnabled()) {
		getLogger().debug(.....);
	}
	
	to save logging un-logged text ?
	
	Cheers,
	
	Marcus
	
On Thu, Sep 05, 2002 at 03:51:12PM +0200, Carsten Ziegeler wrote:
> OK, then +1
> 
> Carsten
> 
> > -----Original Message-----
> > From: Nicola Ken Barozzi [mailto:nicolaken@apache.org]
> > Sent: Thursday, September 05, 2002 3:36 PM
> > To: cocoon-dev@xml.apache.org
> > Subject: Re: [VOTE] Make errors caught only by Cocoon.java
> > 
> > 
> > 
> > Carsten Ziegeler wrote:
> > > 
> > >>-----Original Message-----
> > >>From: Nicola Ken Barozzi [mailto:nicolaken@apache.org]
> > >>Sent: Thursday, September 05, 2002 3:24 PM
> > >>To: cocoon-dev@xml.apache.org
> > >>Subject: [VOTE] Make errors caught only by Cocoon.java
> > >>
> > >>
> > >>I would really like to see the errors caught ONLY by Cocoon.java, and
> > >>logged there. It would reduce the problems we are having a LOT.
> > >>
> > >>+1
> > >>
> > > 
> > > I would like to extend this proposal a little bit by:
> > > 
> > > "Exceptions are only logged when they are consumed (and not rethrown)".
> > > 
> > > So, if I write
> > > try {
> > >    ...
> > > } catch (Exception e) {
> > >   // ignore this...
> > > }
> > > 
> > > this should be logged, perhaps not with level error, but debug.
> > 
> > +1  Yes, that's it.
> > 
> > -- 
> > Nicola Ken Barozzi                   nicolaken@apache.org
> >              - verba volant, scripta manent -
> >     (discussions get forgotten, just code remains)
> > ---------------------------------------------------------------------
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> > For additional commands, email: cocoon-dev-help@xml.apache.org
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
> 

-- 
        .....
     ,,$$$$$$$$$,      Marcus Crafter
    ;$'      '$$$$:    Computer Systems Engineer
    $:         $$$$:   ManageSoft GmbH
     $       o_)$$$:   82-84 Mainzer Landstrasse
     ;$,    _/\ &&:'   60327 Frankfurt Germany
       '     /( &&&
           \_&&&&'
          &&&&.
    &&&&&&&:

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [VOTE] Make errors caught only by Cocoon.java

Posted by Ivelin Ivanov <iv...@apache.org>.
+1 for

> >> "Exceptions are only logged when they are consumed (and not rethrown)".



----- Original Message -----
From: "Vadim Gritsenko" <va...@verizon.net>
To: <co...@xml.apache.org>
Sent: Thursday, September 05, 2002 8:54 AM
Subject: Re: [VOTE] Make errors caught only by Cocoon.java


> Nicola Ken Barozzi wrote:
>
> >
> > Carsten Ziegeler wrote:
> >
> >>
> >>> -----Original Message-----
> >>> From: Nicola Ken Barozzi [mailto:nicolaken@apache.org]
> >>> Sent: Thursday, September 05, 2002 3:24 PM
> >>> To: cocoon-dev@xml.apache.org
> >>> Subject: [VOTE] Make errors caught only by Cocoon.java
> >>>
> >>>
> >>> I would really like to see the errors caught ONLY by Cocoon.java, and
> >>> logged there. It would reduce the problems we are having a LOT.
> >>>
> >>> +1
> >>>
> >>
> >> I would like to extend this proposal a little bit by:
> >
>
> Same here... Minor correction:
>
> >> "Exceptions are only logged when they are consumed (and not rethrown)".
> >>
> >> So, if I write
> >> try {
> >>    ...
> >> } catch (Exception e) {
> >>   // ignore this...
> >> }
> >>
> >> this should be logged, perhaps not with level error, but debug.
> >
>
> And perharps without stacktrace. It is meaningless in 99.9% situations
> to log, i.e., FileNotFoundException's stacktrace.
>
>
> >>
> >
> > +1  Yes, that's it.
>
>
> +1
>
>
> Vadim
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [VOTE] Make errors caught only by Cocoon.java

Posted by Vadim Gritsenko <va...@verizon.net>.
Nicola Ken Barozzi wrote:

>
> Carsten Ziegeler wrote:
>
>>
>>> -----Original Message-----
>>> From: Nicola Ken Barozzi [mailto:nicolaken@apache.org]
>>> Sent: Thursday, September 05, 2002 3:24 PM
>>> To: cocoon-dev@xml.apache.org
>>> Subject: [VOTE] Make errors caught only by Cocoon.java
>>>
>>>
>>> I would really like to see the errors caught ONLY by Cocoon.java, and
>>> logged there. It would reduce the problems we are having a LOT.
>>>
>>> +1
>>>
>>
>> I would like to extend this proposal a little bit by:
>

Same here... Minor correction:

>> "Exceptions are only logged when they are consumed (and not rethrown)".
>>
>> So, if I write
>> try {
>>    ...
>> } catch (Exception e) {
>>   // ignore this...
>> }
>>
>> this should be logged, perhaps not with level error, but debug.
>

And perharps without stacktrace. It is meaningless in 99.9% situations 
to log, i.e., FileNotFoundException's stacktrace.


>>
>
> +1  Yes, that's it.


+1


Vadim






---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


RE: [VOTE] Make errors caught only by Cocoon.java

Posted by Carsten Ziegeler <cz...@s-und-n.de>.
OK, then +1

Carsten

> -----Original Message-----
> From: Nicola Ken Barozzi [mailto:nicolaken@apache.org]
> Sent: Thursday, September 05, 2002 3:36 PM
> To: cocoon-dev@xml.apache.org
> Subject: Re: [VOTE] Make errors caught only by Cocoon.java
> 
> 
> 
> Carsten Ziegeler wrote:
> > 
> >>-----Original Message-----
> >>From: Nicola Ken Barozzi [mailto:nicolaken@apache.org]
> >>Sent: Thursday, September 05, 2002 3:24 PM
> >>To: cocoon-dev@xml.apache.org
> >>Subject: [VOTE] Make errors caught only by Cocoon.java
> >>
> >>
> >>I would really like to see the errors caught ONLY by Cocoon.java, and
> >>logged there. It would reduce the problems we are having a LOT.
> >>
> >>+1
> >>
> > 
> > I would like to extend this proposal a little bit by:
> > 
> > "Exceptions are only logged when they are consumed (and not rethrown)".
> > 
> > So, if I write
> > try {
> >    ...
> > } catch (Exception e) {
> >   // ignore this...
> > }
> > 
> > this should be logged, perhaps not with level error, but debug.
> 
> +1  Yes, that's it.
> 
> -- 
> Nicola Ken Barozzi                   nicolaken@apache.org
>              - verba volant, scripta manent -
>     (discussions get forgotten, just code remains)
> ---------------------------------------------------------------------
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [VOTE] Make errors caught only by Cocoon.java

Posted by Nicola Ken Barozzi <ni...@apache.org>.
Carsten Ziegeler wrote:
> 
>>-----Original Message-----
>>From: Nicola Ken Barozzi [mailto:nicolaken@apache.org]
>>Sent: Thursday, September 05, 2002 3:24 PM
>>To: cocoon-dev@xml.apache.org
>>Subject: [VOTE] Make errors caught only by Cocoon.java
>>
>>
>>I would really like to see the errors caught ONLY by Cocoon.java, and
>>logged there. It would reduce the problems we are having a LOT.
>>
>>+1
>>
> 
> I would like to extend this proposal a little bit by:
> 
> "Exceptions are only logged when they are consumed (and not rethrown)".
> 
> So, if I write
> try {
>    ...
> } catch (Exception e) {
>   // ignore this...
> }
> 
> this should be logged, perhaps not with level error, but debug.

+1  Yes, that's it.

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


RE: [VOTE] Make errors caught only by Cocoon.java

Posted by Carsten Ziegeler <cz...@s-und-n.de>.

> -----Original Message-----
> From: Nicola Ken Barozzi [mailto:nicolaken@apache.org]
> Sent: Thursday, September 05, 2002 3:24 PM
> To: cocoon-dev@xml.apache.org
> Subject: [VOTE] Make errors caught only by Cocoon.java
> 
> 
> I would really like to see the errors caught ONLY by Cocoon.java, and
> logged there. It would reduce the problems we are having a LOT.
> 
> +1
> 
I would like to extend this proposal a little bit by:

"Exceptions are only logged when they are consumed (and not rethrown)".

So, if I write
try {
   ...
} catch (Exception e) {
  // ignore this...
}

this should be logged, perhaps not with level error, but debug.

Carsten



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org