Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does system.out.println in tomcat under windows gets written?

I am using a third party library (cannot modify it) that uses for logging system.out.println statements. The output shows fine in the console but I am not able to retrieve those information in the catalina[...].log file?

Is it possible to send those to log4j?

like image 759
Stainedart Avatar asked Jan 04 '13 13:01

Stainedart


People also ask

Where are Tomcat logs on Windows?

The main Apache Tomcat configuration file is at installdir/apache-tomcat/conf/server. xml. Once Apache Tomcat starts, it will create several log files in the installdir/apache-tomcat/logs directory. The main log file is the catalina.

Where are console logs stored in Tomcat?

The main Apache Tomcat configuration file is at /opt/bitnami/tomcat/conf/server. xml. Once Apache Tomcat starts, it will create several log files in the /opt/bitnami/tomcat/logs directory. The main log file is the catalina.

What is Catalina out file in Tomcat?

The catalina.out log messages and log files communicate events and conditions that affect Tomcat server's operations. Logs for all identity applications components including OSP and Identity Reporting are also logged to the catalina.out file.

How do I view Tomcat logs?

Each server instance contains its own Catalina.This file is located in the logs directory below the Tomcat root directory. This log is the system's output log, which also consists of standard error messages. These files are saved daily (MM-DD-YYYY) with the date appended to the name of the data.


3 Answers

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).

http://tomcat.apache.org/tomcat-7.0-doc/logging.html#Console

like image 73
Clement Liu Avatar answered Oct 31 '22 02:10

Clement Liu


System.out.println() prints out to stdout. Therefore, if you want to see these statements in a log file, you can just redirect stdout where you want it in the Tomcat startup script.

like image 31
fge Avatar answered Oct 31 '22 02:10

fge


You can find those logs also in cat /var/log/messages

if you try

cat /var/log/messages | grep server
like image 28
gori Avatar answered Oct 31 '22 03:10

gori