Tomcat generates the Catalina. Out File

Source: Internet
Author: User

Generate Catalina. Out Method

Lead: This article is a method for outputting console information to the Catalina. Out file for Windows Tomcat and ensuring real-time viewing of log files.

1. Create Catalina. Out

1. Modify the startup. BAT file in the Tomcat bin directory.

Location: the last row of the startup. BAT file

Modify call "% executable %" start % cmd_line_args %

: Call "% executable %" Run % cmd_line_args %

2. Modify the Catalina. BAT file

Location: last few lines of the Catalina. BAT file

To (marked in red for the modification ):

Rem execute Java with the applicable properties

If not "% JPDA %" = "" Goto dojpda

If not "% security_policy_file %" = "" Goto dosecurity

% _ Execjava % java_opts % catalina_opts % debug_opts %-djava. endorsed. dirs = "% java_endorsed_dirs %"-classpath "% classpath %"-dcatalina. base = "% catalina_base %"-dcatalina. home = "% catalina_home %"-djava. io. tmpdir = "% catalina_tmpdir %" % mainclass % cmd_line_args % action %> "% catalina_base %" \ logs \ Catalina _ % Date :~ 0, 4%-% Date :~ 5, 2%-% Date :~ 8, 2%. Out

Goto end

: Dosecurity

% _ Execjava % java_opts % catalina_opts % debug_opts %-djava. endorsed. dirs = "% java_endorsed_dirs %"-classpath "% classpath %"-djava. security. manager-djava. security. policy = "% security_policy_file %"-dcatalina. base = "% catalina_base %"-dcatalina. home = "% catalina_home %"-djava. io. tmpdir = "% catalina_tmpdir %" % mainclass % cmd_line_args % action %> "% catalina_base %" \ logs \ Catalina _ % Date :~ 0, 4%-% Date :~ 5, 2%-% Date :~ 8, 2%. Out

Goto end

: Dojpda

If not "% security_policy_file %" = "" Goto dosecurityjpda

% _ Execjava % java_opts % catalina_opts % jpda_opts % debug_opts %-djava. endorsed. dirs = "% java_endorsed_dirs %"-classpath "% classpath %"-dcatalina. base = "% catalina_base %"-dcatalina. home = "% catalina_home %"-djava. io. tmpdir = "% catalina_tmpdir %" % mainclass % cmd_line_args % action %> "% catalina_base %" \ logs \ Catalina _ % Date :~ 0, 4%-% Date :~ 5, 2%-% Date :~ 8, 2%. Out

Goto end

: Dosecurityjpda

% _ Execjava % java_opts % catalina_opts % jpda_opts % debug_opts %-djava. endorsed. dirs = "% java_endorsed_dirs %"-classpath "% classpath %"-djava. security. manager-djava. security. policy = "% security_policy_file %"-dcatalina. base = "% catalina_base %"-dcatalina. home = "% catalina_home %"-djava. io. tmpdir = "% catalina_tmpdir %" % mainclass % cmd_line_args % action %

> "% Catalina_base %" \ logs \ Catalina _ % Date :~ 0, 4%-% Date :~ 5, 2%-% Date :~ 8, 2%. Out

Goto end

 

: End

3. Start the startup. BAT file to check whether the Catalina. Out file exists in the Tomcat logs directory.

 

2. How to view the Catalina. Out file in real time?

 

1. Install the rktools.exe file to record the installation path.

2. Add the rktools.exe installation path to the PATH environment variable.

In cmd, tail /?, If the following information is displayed, the installation is successful:

 

3. Add the tomcat_s1log.bat file under the Tomcat bin directory (the file name can be customized). The content is as follows:

@ Echo off

If not exist "% catalina_base %" \ logs \ Catalina _ % Date :~ 0, 4%-% Date :~ 5, 2%-% Date :~ 8, 2%. out Echo ""> "% catalina_base %" \ logs \ Catalina _ % Date :~ 0, 4%-% Date :~ 5, 2%-% Date :~ 8, 2%. Out

Tail-F "% catalina_base %" \ logs \ Catalina _ % Date :~ 0, 4%-% Date :~ 5, 2%-% Date :~ 8, 2%. Out

 

4. Modify the Catalina. BAT file

Row 185: echo using jre_home: "% jre_home %"

Goto java_dir_displayed

: Use_jdk

Echo using java_home: "% java_home %"

: Java_dir_displayed

Echo using classpath: "% classpath %"

To:

Echo using jre_home: "% jre_home %"

Tomcat_s1log.bat

Goto java_dir_displayed

: Use_jdk

Echo using java_home: "% java_home %"

: Java_dir_displayed

Echo using classpath: "% classpath %"

5. Start startup. BAT and you will see one startup information interface and one real-time log monitoring interface on the two consoles.

(Note: To enable tomcat_s1log.bat on the desktop, modify tomcat_s1log.bat.

Change "% catalina_base %" to the Tomcat directory .)

Example:

D:

Cd d: \ Program Files \ apache-Tomcat-7.0.5 \ logs

If not exist Catalina _ % Date :~ 0, 4%-% Date :~ 5, 2%-% Date :~ 8, 2%. out Echo ""> Catalina _ % Date :~ 0, 4%-% Date :~ 5, 2%-% Date :~ 8, 2%. Out

Tail-F Catalina _ % Date :~ 0, 4%-% Date :~ 5, 2%-% Date :~ 8, 2%. Out

Tomcat generates the Catalina. Out File

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.