1

So I have a problem that is the reverse of what everyone else on the internet wants.. I want to take tomcat logs that are being written out to /usr/local/tomcat/logs and have them be output to console instead. (Everyone else is asking the reverse.. how to get things away from console and to file). Reason why is because I'm on a system that captures output to console and directs it to an analytics program, it has to go to this program, and I have no control over how this is designed (ie. I can't change the program or capture process to use files as well as console).

To clarify, I am doing this on a Linux system, specifically Alpine.

1

That doc say next:

When running Tomcat on unixes, the console output is usually redirected to the file named catalina.out. The name is configurable using an environment variable. (See the startup scripts). Whatever is written to System.err/out will be caught into that file. That may include:

Uncaught exceptions printed by

  • java.lang.ThreadGroup.uncaughtException(..)

  • Thread dumps, if you requested them via a system signal

When running as a service on Windows, the console output is also caught and redirected, but the file names are different.

The default logging configuration in Apache Tomcat writes the same messages to the console and to a log file. This is great when using Tomcat for development, but usually is not needed in production.

So if you need to catch the same logs which catch analytic software you need read catalina.out file.

Think it's will be helpful to you.

  • catalina.out already goes to console... I'm looking to find a way to get localhost.log and catalina.log out to console too. – Scott Shorkey Nov 2 '18 at 14:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.