Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Why doesn't Tomcat log to System.err?
Why doesn't Tomcat log to System.err? [message #222454] Tue, 30 September 2008 07:42 Go to next message
Eclipse UserFriend
Originally posted by: dontreply.want.ch

Hi all

On Eclipse 3.3.1 (also tried Ganymede 3.4.?), the integrated Tomcat (5.5)
seems to log everything to the Eclipse System.out console. I've set up log4j
to log DEBUG-INFO to System.out and WARN-FATAL to System.err. When running a
unit test, this logging setup works fine, warnings and errors appear in the
color of System.err (red). When launching Tomcat, all messages are black (as
in System.out). The log4j part is definitely ok, if I change the pattern of
the System.err appender, this is reflected in Eclipse console (but black
instead of red)

It's a rather minor issue, but with a Spring/Hibernate webapp, there are
lots of potentially important messages (especially during testing) and
having warnings and errors pop up in red would really help.

Is this a known bug, do I need to reconfigure something?

Thanks a lot
Simon
Re: Why doesn't Tomcat log to System.err? [message #222509 is a reply to message #222454] Tue, 30 September 2008 17:32 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
Simon Niederberger wrote:
> Hi all
>
> On Eclipse 3.3.1 (also tried Ganymede 3.4.?), the integrated Tomcat (5.5)
> seems to log everything to the Eclipse System.out console. I've set up log4j
> to log DEBUG-INFO to System.out and WARN-FATAL to System.err. When running a
> unit test, this logging setup works fine, warnings and errors appear in the
> color of System.err (red). When launching Tomcat, all messages are black (as
> in System.out). The log4j part is definitely ok, if I change the pattern of
> the System.err appender, this is reflected in Eclipse console (but black
> instead of red)
>
> It's a rather minor issue, but with a Spring/Hibernate webapp, there are
> lots of potentially important messages (especially during testing) and
> having warnings and errors pop up in red would really help.
>
> Is this a known bug, do I need to reconfigure something?
>
> Thanks a lot
> Simon
>
>

On Eclipse 3.3.2 and WTP 3.0.2, using a JSP that outputs to System.err
and System.out, I get the following results:

Tomcat 4.0.6: out = black, err = red
Tomcat 4.1.32: out = black, err = black
Tomcat 5.5.26: out = black, err = black
Tomcat 6.0.18: out = black, err = black

Given that the Eclipse/WTP code that launches the server is pretty much
the same regardless of Tomcat version, it suggests that something inside
Tomcat is playing with System.out and System.err since Tomcat 4.1.x.
Unfortunately, my knowledge of the Tomcat code base doesn't quite cover
why this would be happening.

Cheers,
Larry
Re: Why doesn't Tomcat log to System.err? [message #222514 is a reply to message #222509] Tue, 30 September 2008 20:13 Go to previous message
Eclipse UserFriend
Originally posted by: dontreply.want.ch

Larry, thanks a lot for the info on the different versions. Good to know
it's essentially a Tomcat issue.

Investigating further, it seems Tomcat (starting with 5.0) logs everything
written to System.out and System.err to 'catalina.out'. This is usually a
growing logfile in tomcat\logs. I wonder if Eclipse redirects that stream to
its own console (System.out).

to be continued ...

Simon

"Larry Isaacs" <Larry.Isaacs@sas.com> wrote in message
news:gbtnqu$rhq$1@build.eclipse.org...
> Simon Niederberger wrote:
>> Hi all
>>
>> On Eclipse 3.3.1 (also tried Ganymede 3.4.?), the integrated Tomcat (5.5)
>> seems to log everything to the Eclipse System.out console. I've set up
>> log4j to log DEBUG-INFO to System.out and WARN-FATAL to System.err. When
>> running a unit test, this logging setup works fine, warnings and errors
>> appear in the color of System.err (red). When launching Tomcat, all
>> messages are black (as in System.out). The log4j part is definitely ok,
>> if I change the pattern of the System.err appender, this is reflected in
>> Eclipse console (but black instead of red)
>>
>> It's a rather minor issue, but with a Spring/Hibernate webapp, there are
>> lots of potentially important messages (especially during testing) and
>> having warnings and errors pop up in red would really help.
>>
>> Is this a known bug, do I need to reconfigure something?
>>
>> Thanks a lot
>> Simon
>
> On Eclipse 3.3.2 and WTP 3.0.2, using a JSP that outputs to System.err and
> System.out, I get the following results:
>
> Tomcat 4.0.6: out = black, err = red
> Tomcat 4.1.32: out = black, err = black
> Tomcat 5.5.26: out = black, err = black
> Tomcat 6.0.18: out = black, err = black
>
> Given that the Eclipse/WTP code that launches the server is pretty much
> the same regardless of Tomcat version, it suggests that something inside
> Tomcat is playing with System.out and System.err since Tomcat 4.1.x.
> Unfortunately, my knowledge of the Tomcat code base doesn't quite cover
> why this would be happening.
>
> Cheers,
> Larry
Previous Topic:Turn off JavaScript validator
Next Topic:Eclipse newbie looking for UDDI guidance
Goto Forum:
  


Current Time: Tue Apr 16 20:36:24 GMT 2024

Powered by FUDForum. Page generated in 1.27297 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top