Modifying logging configuration for a Tomcat tcServer instance launched inside SpringSource Tool Suite (multiple versions) (2009731)
search cancel

Modifying logging configuration for a Tomcat tcServer instance launched inside SpringSource Tool Suite (multiple versions) (2009731)

book

Article ID: 297373

calendar_today

Updated On:

Products

VMware Spring Runtime

Issue/Introduction

Modifying logging configuration for a Tomcat tcServer instance launched inside SpringSource Tool Suite (multiple versions) (2009731)

When an instance of tcServer or Apache Tomcat is launched from inside of SpringSource Tool Suite (STS), the server is not started by using the standard startup scripts (i.e. startup.sh/shutdown.sh). Instead, the instance is launched directly by STS, which maintains a separate set of configuration files for that instance. So, if you want to change the logging properties, you need to make a few changes to the server configuration in STS.

Environment


Resolution

Resolution

To customize the logging configuration for an instance of tcServer or Tomcat that is launched through STS, complete the following steps:
  1. Click the Package Explorer tab.
  2. Expand the Servers node. You should see a list of servers configured for use in STS. Locate and expand the server in this list that you want to configure.When that node expands, you should see a list of configuration files for that particular server.

    Note: If you do not see a logging.properties file in this list, create one by clicking on the server node. Then click New > File, and name the file logging.properties.
     
  3. Open the file logging.properties and add the following text.
    handlers= java.util.logging.ConsoleHandler.level= INFO
    java.util.logging.ConsoleHandler.level = ALL
    java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
    
    org.apache.catalina.startup.Bootstrap.level=ALL
    org.apache.catalina.startup.Catalina.level=ALL
    org.apache.catalina.startup.ClassLoaderFactory.level=ALL

     
  4. Save the file.
  5. In the Servers tab, double-click the tcServer/Tomcat instance top open a configuration window for this instance.
  6. In General Information, click Open launch configuration. An Edit Configuration window should open.
  7. In the Edit Configuration window, click the Arguments tab.
  8. In the VM arguments text field, add these arguments: 
    Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
    -Djava.util.logging.config.file="full/path/to/logging.properties"
    
  9. Click Apply.
  10. Click OK
  11. Start the tcServer or Tomcat instance.

In the console, you should see some the logging output from Tomcat. If you used the configuration listed above for the logging.properties file, you should see additional logging output from the Bootstrap, Catalina, and ClassLoaderFactory classes.