You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Daniel Serodio <da...@checkforte.com.br> on 2002/10/22 21:19:21 UTC

ConsoleAppender and System.{out,err}.println

I'm maintaining a Java app with tons of System.out.println's all around,
and I'm using log4j in my (new) code.

If I setup log4j to use a ConsoleAppender, will log4j's and println's
output be intermixed in a predictible way? I mean, will each log message
be logged until EOL at least?

Does anyone have any suggestions for using System.out.println and log4j
together in the same app?

Thanks in advance
-- 
[]'s
Daniel Serodio


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: ConsoleAppender and System.{out,err}.println

Posted by Fergus Gallagher <Fe...@OrbisUK.com>.
There's also option of using LoggingOutputStream (in contribs in CVS) which
redirects System.out/.err to log4j.  Handy.

Fergus


On Tue, Oct 22, 2002 at 04:19:21PM -0300, Daniel Serodio wrote:
> I'm maintaining a Java app with tons of System.out.println's all around,
> and I'm using log4j in my (new) code.
> 
> If I setup log4j to use a ConsoleAppender, will log4j's and println's
> output be intermixed in a predictible way? I mean, will each log message
> be logged until EOL at least?
> 
> Does anyone have any suggestions for using System.out.println and log4j
> together in the same app?
> 
> Thanks in advance
> -- 
> []'s
> Daniel Serodio
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>

-- 
Fergus Gallagher          Tel: +44 (20) 8742 1600
Orbis                     Fax: +44 (20) 8742 2649
414 Chiswick High Street  email: Fergus.Gallagher@orbisuk.com
London  W4 5TL            Web: http://www.orbisuk.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: ConsoleAppender and System.{out,err}.println

Posted by sk k <sk...@yahoo.com>.
If want to distinguish log4j msgs form u'r
system.out's then you can use some pattern with
timestamp or className.method.

This way there will be a difference. Also, since log4j
has levels, you may be able to distinguish based on
it.


--- Daniel Serodio <da...@checkforte.com.br> wrote:
> I'm maintaining a Java app with tons of
> System.out.println's all around,
> and I'm using log4j in my (new) code.
> 
> If I setup log4j to use a ConsoleAppender, will
> log4j's and println's
> output be intermixed in a predictible way? I mean,
> will each log message
> be logged until EOL at least?
> 
> Does anyone have any suggestions for using
> System.out.println and log4j
> together in the same app?
> 
> Thanks in advance
> -- 
> []'s
> Daniel Serodio
> 
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


__________________________________________________
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site
http://webhosting.yahoo.com/

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: ConsoleAppender and System.{out,err}.println

Posted by Ceki Gülcü <ce...@qos.ch>.
AFAIK, System.out.println is synchronized.

At 16:19 22.10.2002 -0300, Daniel Serodio wrote:
>I'm maintaining a Java app with tons of System.out.println's all around,
>and I'm using log4j in my (new) code.
>
>If I setup log4j to use a ConsoleAppender, will log4j's and println's
>output be intermixed in a predictible way? I mean, will each log message
>be logged until EOL at least?
>
>Does anyone have any suggestions for using System.out.println and log4j
>together in the same app?
>
>Thanks in advance
>--
>[]'s
>Daniel Serodio

--
Ceki

TCP implementations will follow a general principle of robustness: be
conservative in what you do, be liberal in what you accept from
others. -- Jon Postel, RFC 793



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>