Tomcat STDOUT as Error in Eclipse

tomcat stdout log configuration
tomcat application logs
tomcat 9 logging
tomcat log4j
tomcat application logs are not getting generated
tomcat logging.properties rotate
tomcat access log to stdout
tomcat log file location windows

I am configuring Tomcat (5.5) server in Eclipse (3.3.2). Once I add Tomcat and start it, the output is printed in Eclipse Console. This output is printed in RED indicating its Standard Error. Although the server gets started without any error the normal INFO is also marked as error.

Jul 29, 2010 7:06:14 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.5.0_10\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files\Java\jdk1.5.0_10\bin\..\jre\bin\client;C:\Program Files\Java\jdk1.5.0_10\bin\..\jre\bin;C:\Program Files\CollabNet Subversion Client;C:\Program Files\Java\jdk1.5.0_10\bin;C:\Program Files\Java\jre1.5.0_07\bin;C:\Program Files\Oracle\Oracle9i\9201\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Sybase125\OCS-12_5\bin;C:\Program Files\Sybase125\OCS-12_5\dll;C:\Program Files\Sybase125\OLEDB;C:\Program Files\Rational\ClearCase\bin;C:\Program Files\Ubsw\Wire\Core;Z:\ZUR_GCOMP_DOC\Project_Trust\datamodel\scripts\GC_trust\Release\1.36\01-DDL;K:\scripts\;C:\Program Files\Ubsw\Wire\Core\;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Windows Imaging\;C:\Program Files\MySQL\MySQL Server 5.1\bin;C:\Program Files\apache-maven-2.2.1\bin;C:\Program Files\apache-ant-1.7.0\bin;C:\Viral\Tech\Java\javadb/bin;C:\Program Files\JAD
Jul 29, 2010 7:06:15 PM org.apache.coyote.http11.Http11BaseProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Jul 29, 2010 7:06:15 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1187 ms
Jul 29, 2010 7:06:15 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Jul 29, 2010 7:06:15 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.30
Jul 29, 2010 7:06:15 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Jul 29, 2010 7:06:15 PM org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Jul 29, 2010 7:06:15 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Jul 29, 2010 7:06:15 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/110  config=null
Jul 29, 2010 7:06:15 PM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Jul 29, 2010 7:06:15 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 922 ms

Can anyone let me know how to overcome this and change the output back to BLACK as STDOUT?

It's in red because it's written to standard error (System.err), assuming you're using a normal configuration.

Theoretically, the way to fix this is to adjust the logging configuration (which appears to be java.util.logging based) so that messages at INFO level and below are written to standard out instead. Unfortunately, this is a little bit messier than it might be because the ConsoleHandler class is hard-coded to write to standard error, and if you mix between writing to standard out and standard error, there's a good chance that you'll end up getting the logging messages written out of order. (That's bad. Very confusing.) You could fix it by subclassing StreamHandler and doing a lot of fiddling around – e.g., override publish so it sets the output stream if logging changes from high-level to low-level or vice versa – but I really doubt that the results are going to be what you desire. It's also going to be slow.

Since in a production deployment of Tomcat you don't log to the console anyway (it logs to files by default) I suggest stopping worrying about this.

Tomcat STDOUT as Error in Eclipse - eclipse - html, Once I add Tomcat and start it, the output is printed in Eclipse Console. This output is printed in RED indicating its Standard Error. Although the server gets  Once I add Tomcat and start it, the output is printed in Eclipse Console. This output is printed in RED indicating its Standard Error. Although the server gets started without any error the normal INFO is also marked as error.

There is a short answer to your question :

Right clic in Console view > Preferences...

and then set "Standard Error text color" to black.

But of course, it would be better if Eclipse knew that Tomcat server log is not to be shown in red.

It looks like there are no better answers for now : http://www.eclipse.org/forums/index.php?t=msg&goto=531848&

The problem can be reproduced with Tomcat 6 and Tomcat 7 in Eclipse 3.6.2

Apache Tomcat 7 (7.0.103), In the default distribution this private copy of the library is simplified and hardcoded to use the java.util.logging framework. To configure Tomcat  The error looks something like this: Most of the time, this means that Tomcat is already running in the background and Eclipse is trying to open it again on the same ports. This is obviously not

The following has worked for me.

In the Tomcat server.xml, comment out

<Listener SSLEngine="on" className="org.apache.catalina.core.AprLifecycleListener"/>

Seems like the "red is caused" by Tomcat not be able to load the APR native lib. Skip the loading and no more red.

Logging in Tomcat, Use system logging API, java.util.logging . Use the logging API provided by the Java Servlets specification, javax.servlet.ServletContext.log(). Tomcat 5.5 is configured to use the Juli logger so that each webapp has its own log file. The problem is that Juli does not have properties for maximum file size and file count. Using Juli the files will grow unbounded and only roll at the end of the day.

For me it was some other error. It helped, when I made sure, no errors (only infos) where in the start up log. Apparently tomcat switches to error output if it encounters an error.

Changelog, Add support for specifying Java 14 (with the value 14 ) and Java 15 (with the value 15 ) Fix the broken re-try link on the error page for the FORM authentication Switch the check for terminal availability to test for stdin as using stdout does not  Hey Guys! Ghanshyam Dayma here, if you are facing problem with your tomcat server like failed to start the server then don't worry, In this video I'll show you how to fix it.

Yep, the java.util.logging.ConsoleHandler publishes to System.err (and not to the System.out)...

A workaround that does not involve coding, or just masking any possible error in black is to add to the VM arguments in the eclipse launch configuration:

 -Djava.util.logging.config.file="${workspace_loc}\Servers\Tomcat v8.5 Server at localhost-config\logging.properties"

(adjust the server config folder accordingly)

and create the logging.properties with:

.level=WARNING

This way only problems or potential problems will show in the console, but in red, the fitting color.

Windows Service How-To, It is used only for StartMode java or exe and enables running --LogLevel, Info, Defines the logging level and can be either Error, Info, Warn or If named auto then file is created inside LogPath with the name service-stdout. Hello, I installed the SAP BOP BI PLATFORM 4.0 SP05 (Patch03) but now when I try to start the Apache Tomcat service (services.msc) in Windows Server 2008 (R2) it show me the following error: Windows could not start the Apache Tomcat service on Loc

Apache Tomcat 7 (7.0.103), 63833: Fix an error in the generification of the copied Commons DBCP 1.x code that This is to suppress warnings generated by the Eclipse / Tomcat 57363: Log to stderr if LogManager is unable to read configuration files  Is there a way to catch tomcat stdout and tomcat stderr log files it to log4j or any other way so that i can keep track daily basis.These files are only generated when we restart tomcat.And i want these files to be generated automatically even without restarting a Tomcat Server.How can i achieve this.

A simple guide to Tomcat logging configurations, Tip: Logging, diagnostics, error-free deployment, and advanced application As of Tomcat 5.5, Apache's Java Commons Logging (JCL) technology is used  When Tomcat is started as service it puts its output log in: \logs\stderr.log \logs\stdout.log How to write this log files when Tomcat started as BAT in windows? P.S.: I tried to start Tomcat with: call startup > ../logs/consolelog.log 2<&1 But output of consolelog.log has only 5 lines

How to redirect tomcat console log to files? Tomcat started via , Edit conf/logging.properties and change this line .handlers = 1catalina.org.​apache.juli.FileHandler, java.util.logging.ConsoleHandler. to .handlers  Eclipse versions older than Eclipse Luna 4.4 does not support Tomcat 8 by default. For this tutorial I have used Eclipse Mars 2 for Java EE developers. 1. In Eclipse for Java EE go to Window -> Preferences in Windows OS (or Eclipse -> Preferences on Mac) 2. Go to Server and click Runtime Environments. 3. Click the “Add….” button. 4. In

Comments
  • Would this do it? stackoverflow.com/questions/194165/… and who would one use that with Tomcat?
  • I think this is the easiest solution. Unfortunately, this remains a problem in Eclipse Juno SR2 with Tomcat 7.
  • tomcat 8 and eclipse mars have the same issue too
  • Tried this and it didn't work. I've also configured the APR native lib to load correctly and that didn't change anything either.
  • @SamHasler I noticed the issue happens whenever Tomcat emits any kind of error or warning. Do you see anything else?