Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Eclipse + Tomcat Apache + Console Output
Eclipse + Tomcat Apache + Console Output [message #531848] Thu, 06 May 2010 07:36 Go to next message
No real name is currently offline No real name
Messages: 2
Registered: May 2010
Junior Member
Hi guys,

Using the latest version of Eclipse for Java Enterprise on Windows XP and I have Tomcat Apache 6.0.26 installed. When I start the server the console output (all INFO) is printed in red.
I have been told to change the Console colour settings under Preferences from red to black for Standard Error text color.

If i change that, then console output is now black but calling System.out.print is output in red.

This also happens when I use log4j.
So surely there must be something I missed in either my Tomcat Apache configuration or Log4j config.

logger.error() is printed in black and logger.info() is printed in red.
any ideas why?
System.out and System.err behave as expected.

I have googled a lot and was not able to find a proper answer.

Thanks for your help.
Re: Eclipse + Tomcat Apache + Console Output [message #531995 is a reply to message #531848] Thu, 06 May 2010 13:36 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry Isaacs
Messages: 1287
Registered: July 2009
Senior Member
amarkitanis@gmail.com wrote:
> Hi guys,
>
> Using the latest version of Eclipse for Java Enterprise on Windows XP
> and I have Tomcat Apache 6.0.26 installed. When I start the server the
> console output (all INFO) is printed in red.
> I have been told to change the Console colour settings under Preferences
> from red to black for Standard Error text color.
>
> If i change that, then console output is now black but calling
> System.out.print is output in red.
>
> This also happens when I use log4j.
> So surely there must be something I missed in either my Tomcat Apache
> configuration or Log4j config.
>
> logger.error() is printed in black and logger.info() is printed in red.
> any ideas why?
> System.out and System.err behave as expected.
>
> I have googled a lot and was not able to find a proper answer.
>
> Thanks for your help.

Note that Tomcat 5.5.x doesn't do this, so this behavior would seem to
be caused by something different within Tomcat 6.0.26.

For JULI logging, what is different is when logging gets initialized.
In Tomcat 6.0.x, the java.util.logging.ConsoleHandler (which outputs to
System.err) gets initialized early and outputs to the original
System.err. Later in Tomcat 6.2.x startup, System.out and System.err
are replaced with a SystemLogHandler that outputs to the original
System.out. I believe this helps with the per webapp logging features
of Tomcat. This accounts for the red and black for Tomcat 6.0.x. It
may be a similar issue for Log4J.

In Tomcat 5.5.x using JULI, the System.out and System.err replacement
occurs first, so ConsoleHandler outputs to the replaced System.err which
eventually goes to the original System.out. What this means is that you
don't have access to the original System.out and System.err as Tomcat
takes control of them first.

Cheers,
Larry
Re: Eclipse + Tomcat Apache + Console Output [message #532013 is a reply to message #531995] Thu, 06 May 2010 14:36 Go to previous messageGo to next message
No real name is currently offline No real name
Messages: 2
Registered: May 2010
Junior Member
Thanks for your detailed reply.

At home, I'm running eclipse gallileo with Tomcat 6.0.2 and the INFO messages at the beginning when tomcat is being started are black.

If i replace it with Tomcat 6.026 I get the same behaviour I mentioned in the my first reply.

So something must have changed between the two versions.

Is there a workaround though? Development with red as INFO makes spotting ERROR messages a lot harder. Especially at startup.

Thanks
Re: Eclipse + Tomcat Apache + Console Output [message #532030 is a reply to message #532013] Thu, 06 May 2010 16:00 Go to previous message
Larry Isaacs is currently offline Larry Isaacs
Messages: 1287
Registered: July 2009
Senior Member
amarkitanis@gmail.com wrote:
> Thanks for your detailed reply.
> At home, I'm running eclipse gallileo with Tomcat 6.0.2 and the INFO
> messages at the beginning when tomcat is being started are black.
> If i replace it with Tomcat 6.026 I get the same behaviour I mentioned
> in the my first reply.
>
> So something must have changed between the two versions.
>
> Is there a workaround though? Development with red as INFO makes
> spotting ERROR messages a lot harder. Especially at startup.
>
> Thanks

I don't think these logging frameworks typically log to multiple streams
based on level. If you want a console logger that outputs to System.out
for one set of levels and System.err for the other levels, you will have
to implement one yourself.

Cheers,
Larry
Previous Topic:Java EE Module Dependencies not exporting
Next Topic:Is there code example for inferring a method?
Goto Forum:
  


Current Time: Sat Apr 19 05:54:32 EDT 2014

Powered by FUDForum. Page generated in 0.01803 seconds