You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Nishant Deshpande <ni...@gmail.com> on 2006/06/16 04:18:11 UTC

flushing system.out

i'm printing stuff out to system.out in tomcat, but it doesn't get
flushed till the end of the request.

(i've tried system.out.flush())

has anyone got solutions to this problem? i'm not sure if its a tomcat
problem or some OS / jvm thing...

thanks

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: flushing system.out

Posted by Nishant Deshpande <ni...@gmail.com>.
I'm using Tomcat 5.0.28 and SuSe Linux 9.3

On 6/15/06, Mir Kasim Ali <mi...@gmail.com> wrote:
> Can u tell me which OS ure using and what version of Tomcat
>
> On 6/16/06, Nishant Deshpande <ni...@gmail.com> wrote:
> >
> > i'm printing stuff out to system.out in tomcat, but it doesn't get
> > flushed till the end of the request.
> >
> > (i've tried system.out.flush())
> >
> > has anyone got solutions to this problem? i'm not sure if its a tomcat
> > problem or some OS / jvm thing...
> >
> > thanks
> >
> > ---------------------------------------------------------------------
> > To start a new topic, e-mail: users@tomcat.apache.org
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> >
>
>
> --
> Mir Kasim Ali
>
>

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: flushing system.out

Posted by Mir Kasim Ali <mi...@gmail.com>.
Can u tell me which OS ure using and what version of Tomcat

On 6/16/06, Nishant Deshpande <ni...@gmail.com> wrote:
>
> i'm printing stuff out to system.out in tomcat, but it doesn't get
> flushed till the end of the request.
>
> (i've tried system.out.flush())
>
> has anyone got solutions to this problem? i'm not sure if its a tomcat
> problem or some OS / jvm thing...
>
> thanks
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
Mir Kasim Ali

Re: flushing system.out

Posted by Glenn Holliday <gh...@csc.com>.
I agree, and also suggest that usually, you don't want debugging turned on 
in a highly concurrent environment.  Or other high volume environments, or 
for production in general.  At least, not that kind of shotgun debugging. 
But it can be helpful when you encounter a 1-minute question and answer 
during development or testing.

--
Glenn Holliday
Computer Sciences Corporation
ghollida@csc.com 540-644-6636


--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
This is a PRIVATE message. If you are not the intended recipient, please 
delete without copying and kindly advise us by e-mail of the mistake in 
delivery. NOTE: Regardless of content, this e-mail shall not operate to 
bind CSC to any order or other contract unless pursuant to explicit 
written agreement or government initiative expressly permitting the use of 
e-mail for such purpose.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------




Filip Hanik - Dev Lists <de...@hanik.com> 
06/16/2006 08:45 AM
Please respond to
"Tomcat Users List" <us...@tomcat.apache.org>


To
Tomcat Users List <us...@tomcat.apache.org>
cc

Subject
Re: flushing system.out






System.out.println is a synchronized call, and will become a performance 
bottleneck on highly concurrent applications,
the ideal is to use a logging framework, and setup an async logger

Filip


Glenn Holliday wrote:
> I frequently see it used for debugging.  It's an easy place to log to. 
> That's also when you most want unbuffered output.  Is that practice 
> discommended for other reasons?
>
> Tim Funk <fu...@joedog.org> 
> 06/16/2006 07:14 AM
> Please respond to
> "Tomcat Users List" <us...@tomcat.apache.org>
>
>
> To
> Tomcat Users List <us...@tomcat.apache.org>
> cc
>
> Subject
> Re: flushing system.out
>
>
>
>
>
>
> I doubt you want to print to system.out in a servlet (or jsp).
>




---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: flushing system.out

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
System.out.println is a synchronized call, and will become a performance 
bottleneck on highly concurrent applications,
the ideal is to use a logging framework, and setup an async logger

Filip


Glenn Holliday wrote:
> I frequently see it used for debugging.  It's an easy place to log to. 
> That's also when you most want unbuffered output.  Is that practice 
> discommended for other reasons?
>
> --
> Glenn Holliday
> Computer Sciences Corporation
> ghollida@csc.com 540-644-6636
>
>
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> This is a PRIVATE message. If you are not the intended recipient, please 
> delete without copying and kindly advise us by e-mail of the mistake in 
> delivery. NOTE: Regardless of content, this e-mail shall not operate to 
> bind CSC to any order or other contract unless pursuant to explicit 
> written agreement or government initiative expressly permitting the use of 
> e-mail for such purpose.
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>
>
>
> Tim Funk <fu...@joedog.org> 
> 06/16/2006 07:14 AM
> Please respond to
> "Tomcat Users List" <us...@tomcat.apache.org>
>
>
> To
> Tomcat Users List <us...@tomcat.apache.org>
> cc
>
> Subject
> Re: flushing system.out
>
>
>
>
>
>
> I doubt you want to print to system.out in a servlet (or jsp).
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>   


-- 


Filip Hanik

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: flushing system.out

Posted by Glenn Holliday <gh...@csc.com>.
I frequently see it used for debugging.  It's an easy place to log to. 
That's also when you most want unbuffered output.  Is that practice 
discommended for other reasons?

--
Glenn Holliday
Computer Sciences Corporation
ghollida@csc.com 540-644-6636


--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
This is a PRIVATE message. If you are not the intended recipient, please 
delete without copying and kindly advise us by e-mail of the mistake in 
delivery. NOTE: Regardless of content, this e-mail shall not operate to 
bind CSC to any order or other contract unless pursuant to explicit 
written agreement or government initiative expressly permitting the use of 
e-mail for such purpose.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------




Tim Funk <fu...@joedog.org> 
06/16/2006 07:14 AM
Please respond to
"Tomcat Users List" <us...@tomcat.apache.org>


To
Tomcat Users List <us...@tomcat.apache.org>
cc

Subject
Re: flushing system.out






I doubt you want to print to system.out in a servlet (or jsp).






---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: flushing system.out

Posted by Tim Funk <fu...@joedog.org>.
I doubt you want to print to system.out in a servlet (or jsp).

Odds are you want flushBuffer
http://tomcat.apache.org/tomcat-5.0-doc/servletapi/javax/servlet/ServletResponseWrapper.html#flushBuffer()

or flush
http://tomcat.apache.org/tomcat-5.0-doc/jspapi/javax/servlet/jsp/JspWriter.html#flush()

-Tim

Nishant Deshpande wrote:
> i'm printing stuff out to system.out in tomcat, but it doesn't get
> flushed till the end of the request.
> 
> (i've tried system.out.flush())
> 
> has anyone got solutions to this problem? i'm not sure if its a tomcat
> problem or some OS / jvm thing...
> 

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org