Working with Tomcat application logs

In this recipe, you will learn how to work with logs in Tomcat cartridges. You will start with tailing the logs of an existing Tomcat application, and then you will learn how to add application-specific logging using the SLF4J library.

Getting ready

This recipe will use the application created in the Creating and Deploying Spring Applications using the Tomcat 7 cartridge recipe in Chapter 7, OpenShift for Java Developers. You can recreate the application using the following command:

$ rhc create-app jobstore tomcat-7 mysql-5.5 --from-code --timeout 180

How to do it…

Perform the following steps:

  1. You can view the logs of a Tomcat application using ...

Get OpenShift Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.