Pivotal Knowledge Base

Follow

Deleting or rotating the wrapper.log file in Pivotal tc Server (2010299)

Deleting or rotating the wrapper.log file in Pivotal tc Server (2010299)

Purpose

When running tc Server on the Windows platform, a special service wrapper is used, so that the Java process can run as a Windows service. When the wrapper launches a tc Server instance, it creates a logs/wrapper.log file. By default, this file is not configured to rotate and continues to grow with time.
 
This article provides steps to manage the growth of the logs/wrapper.log file.

Resolution

To handle the growth of the logs/wrapper.log file, you can either:
  1. Delete the file when your tc Server instance is restarted.
  2. Enable rotation of the file.

Deleting the File

You can manually delete the logs/wrapper.log file when the server is brought down for other maintenance jobs or can automate the deletion.
 
To automate the deletion of the logs/wrapper.log file:
  1. Open the conf/wrapper.conf file using a text editor.
  2. Locate the section titled Wrapper Logging Properties.
  3. In that section, add this entry:

    wrapper.logfile.rollmode. = WRAPPER
  4. Locate the property wrapper.logfile.maxfiles.
  5. Set the value of this property to 1.
  6. Restart your tc Server instance.

After you make these changes, the wrapper automatically starts with a fresh log file whenever the Windows service is restarted .

Rotating the File

You can rotate the log file either by size or by date.
 
To rotate the wrapper.log file by date:
  1. Open the conf/wrapper.conf file using a text editor.
  2. Locate the section titled Wrapper Logging Properties.
  3. In that section, add this entry:

    wrapper.logfile.rollmode = DATE
  4. Locate the wrapper.logfile property.
  5. Set its value to %CATALINA_BASE%\logs\wrapper-YYYYMMDD.log.
  6. Restart your tc Server instance

To rotate the wrapper.log file by size:

  1. Open the conf/wrapper.conf file using a text editor.
  2. Locate the section titled Wrapper Logging Properties.
  3. Set the value of the wrapper.logfile.maxsize property to the size at which the log file should rotate. For example:

    wrapper.logfile.maxsize = 10m

    This sets the wrapper to roll the log when it reaches a 10MB size.

    Note: When specifying size for the wrapper.logfile.maxsize property, use the abbreviation M for MB and K for KB.
  4. Restart your tc Server instance.

Note :When rotating by size, you need not add the wrapper.logfile.rollmode property because the default value for this property is to rotate by size.

©VMware 2013

Comments

Powered by Zendesk