19

I have a tomcat on a linux machine and I can visualize the "catalina.out" file.

I wanted to migrate my development environment (Eclipse IDE, JDK 6, Tomcat 6, etc.) from linux to windows.

Everything is ok but, I cannot find the "catalina.out" on my windows tomcat !

I read this post but the solution is not suitable for the eclipse IDE (as i'm launching tomcat from eclipse).

How can I generate the "catalina.out" file in windows ?

Thank you

Community
  • 1
  • 1
Pen
  • 333
  • 2
  • 4
  • 8

6 Answers6

9

catalina.out and other CATALINA_HOME/logs/*.log files are completely different logs.

All CATALINA_HOME/logs/catalina*.log files belongs to Tomcat server. If you don't use Tomcat's JULI you won't find them really useful.

catalina.out is just a redirected output from running server. If your app is logging on console (e.g. by using ConsoleAppender in log4j) you will find your logs there.

Problem is that windows startup script doesn't contain support for catalina.out. You won't find e.g. parameter CATALINA_OUT. So it's not possible to use it and you have to configure your logging library to create file by itself or fix catalina.bat. I'm not a Windows user but you should check lines like:

%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% ....

and put some redirections at the end

%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% .... >> %CATALINA_BASE%\logs\catalina.out
Andrzej Polis
  • 3,205
  • 2
  • 14
  • 10
4

Catalina.out is not generated for windows but you can send command line tomcat output to file by editing catalina.bat or startup.bat. In startup.bat:

replace

call "%EXECUTABLE%" start %CMD_LINE_ARGS%

with

call "%EXECUTABLE%" run >..\logs\stdout.log 2>&1 start %CMD_LINE_ARGS% run >..\logs\stdout.log 2>&1
tkolleh
  • 423
  • 5
  • 16
3

It is in "Tomcat folder\logs", and the name is different: catalina-2011-11-23.log, where 2011-11-23 represents the date in American format.

belgther
  • 2,544
  • 17
  • 15
  • 3
    I have no file in the "logs" folder begging with "catalina". Should I enable it somewhere ? thanks. – Pen Nov 23 '11 at 09:12
3

In the view named 'Servers' you should find your tomcat instance.

If you double click the server in this view a dialog opens where you can configure the server settings. Where you find catalina.out depends on the setting of 'Server Locations'.

If you select the option Use Tomcat installation and set the path to your TOMCAT_HOME (installation folder of tomcat) eclipse will control this instance an you will find everything on a well defined place.

If you do something different you need to find out the value of ${catalina.home} during runtime. I remember issues with other options since the application will be deployed in your workspace under .metadata\.plugins\org.eclipse.wst.server.core and redeploy appeared unreliable.

In the server settings dialog is a link 'Open Launch configuration' which shows the dialog 'Edit configurations' for this server. In the tab Arguments you will find under vm-argsuments -Dcatalina.base="C:\dev\apache-tomcat-6.0.32" -Dcatalina.home="C:\dev\apache-tomcat-6.0.32"

stacker
  • 68,052
  • 28
  • 140
  • 210
  • Thanks for the answer. I always check the "Use Tomcat Installation". And when I check the tomcat logs folder, the only files I find are : log4j.log and other personilzed logging files. The only missing file (in compraison with the linux development environment) is the "catalina.out". – Pen Nov 23 '11 at 09:54
  • @Pen I updated my answer, do you get any output in your console windows after launching tomcat? – stacker Nov 23 '11 at 10:23
  • Yes, I get some general info about the tomcat launching stacktrace. – Pen Nov 23 '11 at 11:24
0

I was able to find where my catalina.out log location was by checking: Tomcat\conf\logging.properties

See the following lines:

1catalina.org.apache.juli.AsyncFileHandler.level = FINE
1catalina.org.apache.juli.AsyncFileHandler.directory = c:/logs
1catalina.org.apache.juli.AsyncFileHandler.prefix = catalina.

2localhost.org.apache.juli.AsyncFileHandler.level = FINE
2localhost.org.apache.juli.AsyncFileHandler.directory = c:/logs
2localhost.org.apache.juli.AsyncFileHandler.prefix = localhost.

3manager.org.apache.juli.AsyncFileHandler.level = FINE
3manager.org.apache.juli.AsyncFileHandler.directory = c:/logs
3manager.org.apache.juli.AsyncFileHandler.prefix = manager.

4host-manager.org.apache.juli.AsyncFileHandler.level = FINE
4host-manager.org.apache.juli.AsyncFileHandler.directory = c:/logs
4host-manager.org.apache.juli.AsyncFileHandler.prefix = host-manager.
Sal
  • 5,129
  • 5
  • 27
  • 53
0

Have you checked the localhost.[date].log?

adarshr
  • 61,315
  • 23
  • 138
  • 167