Redirect error output from Java

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Redirect error output from Java

Florent Georges
  Hi

  Is it possible to redirect the error output from within
Java?  I found nothing for now.

  Thanks,

--drkm






















       

       
               
___________________________________________________________________________
Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger
Téléchargez cette version sur http://fr.messenger.yahoo.com


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

Re: Redirect error output from Java

George Cristian Bina
Look at System.setErr() method:
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/System.html#setErr(java.io.PrintStream)

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


drkm wrote:

>   Hi
>
>   Is it possible to redirect the error output from within
> Java?  I found nothing for now.
>
>   Thanks,
>
> --drkm
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> ___________________________________________________________________________
> Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger
> Téléchargez cette version sur http://fr.messenger.yahoo.com
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by:
> Tame your development challenges with Apache's Geronimo App Server. Download
> it for free - -and be entered to win a 42" plasma tv or your very own
> Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
> _______________________________________________
> saxon-help mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

RE: Redirect error output from Java

Michael Kay
In reply to this post by Florent Georges
Well, that's not really a Saxon question! But you might find the answer in

http://www.javaworld.com/javaworld/javatips/jw-javatip33.html

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of drkm
> Sent: 08 November 2005 10:32
> To: Saxon Help SF list
> Subject: [saxon] Redirect error output from Java
>
>   Hi
>
>   Is it possible to redirect the error output from within
> Java?  I found nothing for now.
>
>   Thanks,
>
> --drkm
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> ______________________________________________________________
> _____________
> Appel audio GRATUIT partout dans le monde avec le nouveau
> Yahoo! Messenger
> Téléchargez cette version sur http://fr.messenger.yahoo.com
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by:
> Tame your development challenges with Apache's Geronimo App
> Server. Download
> it for free - -and be entered to win a 42" plasma tv or your very own
> Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
> _______________________________________________
> saxon-help mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help
>




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

RE: Redirect error output from Java

Florent Georges
Michael Kay wrote:

> Well, that's not really a Saxon question!

  Indeed.  It wasn't clear, but my question was more like : "Is it
possible to change the way Saxon outputs its error messages?".  Because
Saxon is not the only tool that use stderr in my application.

  Actually, my question was not about redirecting streams, because the
goal is to manage the error messages with LOG4J.  (Hum, yes, my
original question was definitely not clear, sorry)

  Thanks,

--drkm





















       

       
               
___________________________________________________________________________
Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger
Téléchargez cette version sur http://fr.messenger.yahoo.com


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

Re: Redirect error output from Java

Christian Roth-4
drkm wrote:

>  Indeed.  It wasn't clear, but my question was more like : "Is it
>possible to change the way Saxon outputs its error messages?".  Because
>Saxon is not the only tool that use stderr in my application.

Is using/writing your own ErrorListener (and in the callbacks calling
the Log4j API with the messages from the passed exceptions) what you are
looking for? This is what I do in my application to have the messages be
"redirected" into my application's log4j-controlled log.

Regards, Christian.



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

RE: Redirect error output from Java

Michael Kay
In reply to this post by Florent Georges
 
>   Indeed.  It wasn't clear, but my question was more like : "Is it
> possible to change the way Saxon outputs its error
> messages?".  

You can either write your own ErrorListener, in which case you have complete
control over the destination and formatting of the messages; or you can call
setErrorOutput() on the standard ErrorListener, which allows you to control
the destination of the messages but not their format.

Michael Kay
http://www.saxonica.com/




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

Re: Redirect error output from Java

Florent Georges
In reply to this post by George Cristian Bina
George Cristian Bina wrote:

> Look at System.setErr() method:

  Thanks.  But it's not what I look for (I wasn't clear in my question,
sorry).  I'd like to manage myself the outputing of the error messages
(actually, to use LOG4J).  Or at lease, if I could redirect the output
only for Saxon (not for the whole application).

  Thanks,

--drkm




















       

       
               
___________________________________________________________________________
Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger
Téléchargez cette version sur http://fr.messenger.yahoo.com


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

RE: Redirect error output from Java

Florent Georges
In reply to this post by Michael Kay
Michael Kay wrote:

> You can either write your own ErrorListener

  Oops.  It's exactly what I looked for, but I looked for such
a class in the Saxon Javadoc, not in the SAXP doc, sorry.

  Thanks for your prompt reply,

--drkm





















       

       
               
___________________________________________________________________________
Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger
Téléchargez cette version sur http://fr.messenger.yahoo.com


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help