cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <joerg.heini...@gmx.de>
Subject Re: Catching errors in flowscript
Date Thu, 13 Mar 2008 12:19:37 GMT
Like this: https://issues.apache.org/jira/browse/COCOON-1205 ?

For logging you obviously can not select the file to log to in the code. 
This would end up in a mess. The components are set up to log to a 
certain logger beforehands, in particular look at cocoon.xconf [1] 
starting at line 50. <flow-interpreters> has a logger attribute. If you 
have a corresponding category in your logkit.xconf [2] (It's not the 
latest version! It got simplified afterwards.) it will log to that file.

Joerg

[1] 
http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/webapp/WEB-INF/cocoon.xconf?revision=607115&view=markup
[2] 
http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/webapp/WEB-INF/logkit.xconf?revision=153831&view=markup

On 13.03.2008 07:31, Derek Hohls wrote:
>  Johannes 
>  
> Thanks for all the options!
>  
> For now I am just sending it to screen while I am debugging;
> but you're right that it should go to a log file for the deployed 
> application.  
>  
> Is there a way to send it a log file other than the default one?
> ie. can I specify a different file name?
>  
> Derek
> 
>>>> On 2008/03/13 at 12:59, in message <20080313105959.6710@gmx.net>, "Johannes
Textor" <jc.textor@gmx.de> wrote:
> not sure where the "print" output ends up, though. I'd use
> 
> try {
>    //do something stupid!   
> } catch(err) {
>    cocoon.log.error( err ); 
> }
> 
> or, if you want it less verbose, 
> 
> try {
>    //do something stupid!   
> } catch(err) {
>    cocoon.log.error( err.getMessage() ); 
> }
> 
> In these cases the error will end up in one of the log files in WEB-INF/log, depending
on your version.
> 
> If you want to do it "the wrong way" and send the error directly to stdout: 
> 
> try {
>    //do something stupid!   
> } catch(err) {
>   err.printStackTrace();
> }
> 
> HTH,
> Johannes
> 
> -------- Original-Nachricht --------
>> Datum: Thu, 13 Mar 2008 12:15:55 +0200
>> Von: Andre Juffer <Andre.Juffer@oulu.fi>
>> An: users@cocoon.apache.org 
>> Betreff: Re: Catching errors in flowscript
> 
>> Derek Hohls wrote:
>>> Using C2.1.8
>>>  
>>> If I have the following:
>>>  
>>>  try {
>>>    //do something stupid!   
>>>  } catch(err) {
>>>   print ("Your error: "+err.description)
>>>  }
>> err is an Java exception or a javascript Error, so err.message or 
>> err.getMessage() should work.
>>
>>>  
>>> Then the print statement does not yield the error description;
>>> is there some way of doing this?
>>>  
>>> Thanks
>>> Derek
> 
> 
> 
> 

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


Mime
View raw message