2

I have a Tomcat log directory with very many log files in it.

I want to determine which JVM was running this Tomcat. I could not find anything in the logs I lessed and I do not even know if it's possible to get this information from the logs.

Does anyone know if this information is available?

dsolimano
  • 1,290
  • 2
  • 14
  • 26
bmscomp
  • 129
  • 5

1 Answers1

2

Tomcat 7/8

I see these in catalina.out for Tomcat 8; might be a matter of parsing this file for the right strings:

12-Mar-2015 11:20:11.411 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /app/java/jdk1.7.0_75/jre
12-Mar-2015 11:20:11.412 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.7.0_75-b13
12-Mar-2015 11:20:11.415 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation

Background info: The VersionLoggerListener is responsible for these lines. It was introduced in the Tomcat 7 API.

Tomcat 6

Edited For Tomcat 6

This information does not appear in catalina.out; try the output of ps -ef | grep tomcat1 instead:

tomcat   13410     1  0 Apr13 ?        00:16:52 /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java -Djava.util.logging.config.file=/app/tomcat/apache-tomcat-6.0.37/conf/logging.properties ...

[1] This may vary by your setup; you may have to grep for a different user and/or process

KM.
  • 1,746
  • 2
  • 18
  • 31