You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Wim Deblauwe <wi...@gmail.com> on 2005/11/09 08:50:25 UTC

[commons-logging] redirect stdout and stderr

Hi,

How can I redirect stdout and stderr to commons-logging? When a
NullPointerException occurs, I want this to be in my log file. How can I do
this. I know I can do this with log4j by using LoggingOutputStream (See
http://cvs.apache.org/viewcvs.cgi/jakarta-log4j/contribs/JimMoore/LoggingOutputStream.java?view=markup).
Is there a way to do this without directly depending on log4j?

regards,

Wim

Re: [commons-logging] redirect stdout and stderr

Posted by Wim Deblauwe <wi...@gmail.com>.
Added bug 37427 to Bugzilla (they don't seem to use the fantastic jira)

regards,

Wim


2005/11/9, Martin van den Bemt <ml...@mvdb.net>:
>
> Bad reading on my part sorry for the noice :(.
> Just did a grep in the code and cannot find any System.out / System.errhijacking, so don't think it
> is currently possible.
> You can always try to file a jira issue, to see how the core developers of
> logging think about
> adding this kind of functionality..
>
> Mvgr,
> Martin
>
> Wim Deblauwe wrote:
> > I'm afraid that is the reverse of what I'm looking for. I don't want my
> > logging to go to stderr, instead I want the stderr output to go to
> whatever
> > log system I have configured in commons-logging.
> >
> > regards,
> >
> > Wim
> >
> > 2005/11/9, Martin van den Bemt <ml...@mvdb.net>:
> >
> >>Use SimpleLog (which is in the commons-logging codebase).
> >>See
> >>
> http://jakarta.apache.org/commons/logging/commons-logging-1.0.4/docs/guide.html#Configuration
> >>Though the javadoc doesn't seem to be online / in the place where the
> site
> >>is pointing too..
> >>
> >>
> >>Mvgr,
> >>Martin
> >>
> >>Wim Deblauwe wrote:
> >>
> >>>Hi,
> >>>
> >>>How can I redirect stdout and stderr to commons-logging? When a
> >>>NullPointerException occurs, I want this to be in my log file. How can
> I
> >>
> >>do
> >>
> >>>this. I know I can do this with log4j by using LoggingOutputStream (See
> >>>
> >>
> >>
> http://cvs.apache.org/viewcvs.cgi/jakarta-log4j/contribs/JimMoore/LoggingOutputStream.java?view=markup)
> >>.
> >>
> >>>Is there a way to do this without directly depending on log4j?
> >>>
> >>>regards,
> >>>
> >>>Wim
> >>>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >>
> >>
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>

Re: [commons-logging] redirect stdout and stderr

Posted by Martin van den Bemt <ml...@mvdb.net>.
Bad reading on my part sorry for the noice :(.
Just did a grep in the code and cannot find any System.out / System.err hijacking, so don't think it 
is currently possible.
You can always try to file a jira issue, to see how the core developers of logging think about 
adding this kind of functionality..

Mvgr,
Martin

Wim Deblauwe wrote:
> I'm afraid that is the reverse of what I'm looking for. I don't want my
> logging to go to stderr, instead I want the stderr output to go to whatever
> log system I have configured in commons-logging.
> 
> regards,
> 
> Wim
> 
> 2005/11/9, Martin van den Bemt <ml...@mvdb.net>:
> 
>>Use SimpleLog (which is in the commons-logging codebase).
>>See
>>http://jakarta.apache.org/commons/logging/commons-logging-1.0.4/docs/guide.html#Configuration
>>Though the javadoc doesn't seem to be online / in the place where the site
>>is pointing too..
>>
>>
>>Mvgr,
>>Martin
>>
>>Wim Deblauwe wrote:
>>
>>>Hi,
>>>
>>>How can I redirect stdout and stderr to commons-logging? When a
>>>NullPointerException occurs, I want this to be in my log file. How can I
>>
>>do
>>
>>>this. I know I can do this with log4j by using LoggingOutputStream (See
>>>
>>
>>http://cvs.apache.org/viewcvs.cgi/jakarta-log4j/contribs/JimMoore/LoggingOutputStream.java?view=markup)
>>.
>>
>>>Is there a way to do this without directly depending on log4j?
>>>
>>>regards,
>>>
>>>Wim
>>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>
>>
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [commons-logging] redirect stdout and stderr

Posted by Wim Deblauwe <wi...@gmail.com>.
I'm afraid that is the reverse of what I'm looking for. I don't want my
logging to go to stderr, instead I want the stderr output to go to whatever
log system I have configured in commons-logging.

regards,

Wim

2005/11/9, Martin van den Bemt <ml...@mvdb.net>:
>
> Use SimpleLog (which is in the commons-logging codebase).
> See
> http://jakarta.apache.org/commons/logging/commons-logging-1.0.4/docs/guide.html#Configuration
> Though the javadoc doesn't seem to be online / in the place where the site
> is pointing too..
>
>
> Mvgr,
> Martin
>
> Wim Deblauwe wrote:
> > Hi,
> >
> > How can I redirect stdout and stderr to commons-logging? When a
> > NullPointerException occurs, I want this to be in my log file. How can I
> do
> > this. I know I can do this with log4j by using LoggingOutputStream (See
> >
> http://cvs.apache.org/viewcvs.cgi/jakarta-log4j/contribs/JimMoore/LoggingOutputStream.java?view=markup)
> .
> > Is there a way to do this without directly depending on log4j?
> >
> > regards,
> >
> > Wim
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>

Re: [commons-logging] redirect stdout and stderr

Posted by Martin van den Bemt <ml...@mvdb.net>.
Use SimpleLog (which is in the commons-logging codebase).
See http://jakarta.apache.org/commons/logging/commons-logging-1.0.4/docs/guide.html#Configuration
Though the javadoc doesn't seem to be online / in the place where the site is pointing too..


Mvgr,
Martin

Wim Deblauwe wrote:
> Hi,
> 
> How can I redirect stdout and stderr to commons-logging? When a
> NullPointerException occurs, I want this to be in my log file. How can I do
> this. I know I can do this with log4j by using LoggingOutputStream (See
> http://cvs.apache.org/viewcvs.cgi/jakarta-log4j/contribs/JimMoore/LoggingOutputStream.java?view=markup).
> Is there a way to do this without directly depending on log4j?
> 
> regards,
> 
> Wim
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org