How to hide verbose Tomcat 6 logging?


I'd like to hide all the verbose logging messages that I see when starting a web application in IDEA 9. Like this:

INFO: Initializing Coyote HTTP/1.1 on http-80
28.10.2010 12:36:39 org.apache.coyote.ajp.AjpAprProtocol init
INFO: Initializing Coyote AJP/1.3 on ajp-8009

INFO: Starting Coyote HTTP/1.1 on http-80
28.10.2010 12:36:52 org.apache.coyote.ajp.AjpAprProtocol start
INFO: Starting Coyote AJP/1.3 on ajp-8009
28.10.2010 12:36:52 org.apache.catalina.startup.Catalina start
INFO: Server startup in 13021 ms

I can hardly make out my own statements in the mess it creates.



IDEA is simply showing what goes into the tomcat log. So you need to modify the tomcat's logging, your web app's logging, or both. One option is to configure your Tomcat Run/Debug configuration to open your web application's log file in a separate tab.



Well, in the "Logs" Tab (that can also be seen in your screenshot) I tried toggling the flag for 'Is Active' and/or for 'Skip Content' as well as removing the entry as a whole from the list.
Nothing changed.

I'm not sure how the "Edit Log Files Aliases"-popup can change anything :-?


You need to add a log "mapping" to the run/debug configuration. This should point to your web application's log file. The dialog that is shown in my previous screenshot was opened by clicking the Add button. Enter in that dialog a name (i.e. alias) such as "My Web App's Log" and the path to your web application's log file.  If your log file name contains a date stamp, you can wild character that. So if your file is foo-webapp-2010-10-28.log, enter "/path/to/logs/foo-webapp-*.log". Save the changes. When you run or debug your tomcat configuration, there will be an additional tab on the Run or Debug tool window, with the name you supplied in the alias, showing the information going into the log file you specified.

I am of course assuming your web application logs to a log file  specified in some type of logging configuration file such as log4j.xml,  logback.xml,, etc. per standard practices.

See the following help pages in IDEA or on the web for more inforation:


Thank you for your answer.

Well, I configured my application to output the logging just to the console - not a file (btw, in production it also puts warnings in a database).

Furthermore, you talk of a log file - but how am I supposed to find the 'log file' of Tomcat (because the logging obviously comes from Tomcat directly, not my application) ?

INFO: Deploying configuration descriptor ROOT.xml
30.10.2010 11:54:38 org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext

11:54:45.361 [main] INFO  com.example.Boot - STARTING UP

(the different formatting is clearly visible - first lines are Tomcat, last line is mine)

Or am I missing the point?


Please sign in to leave a comment.