logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Irving, Dave" <Dave.Irv...@logicacmg.com>
Subject RE: Redirecting stderr and stdout through log4j
Date Wed, 10 Aug 2005 10:49:48 GMT
One easy way would be to write a PrintStream implementation
(LoggingPrintStream, say) which issued logging statements.
Then use System.setErr and System.setOut with your LoggingPrintStream.

However, I haven't used log4j much - as it didn't suit the needs of my
application - so there are probably better ways of doing this within
Log4J.

-----Original Message-----
From: Benjamin David [mailto:bdavid01@gmail.com] 
Sent: 10 August 2005 11:45
To: log4j-user@logging.apache.org
Subject: Redirecting stderr and stdout through log4j

Hi,

I am currently using log4j in an application to log my debug, info,
error , etc messages to a file and all is fine, but I also need to log
the output from stderr and stdout to the same file.
I would like to take the stderr and stdout streams and feed them into
log4j so they are sent to the same file than my debug, info, error
messages, or something to that effect.

Is there any way of doing this ?
Thanks,

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



This e-mail and any attachment is for authorised use by the intended recipient(s) only. It
may contain proprietary material, confidential information and/or be subject to legal privilege.
It should not be copied, disclosed to, retained or used by, any other party. If you are not
an intended recipient then please promptly delete this e-mail and any attachment and all copies
and inform the sender. Thank you.

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


Mime
View raw message