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

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

book

Article ID: 294582

calendar_today

Updated On:

Products

Services Suite

Issue/Introduction

Symptoms:
When the service 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.

Environment


Cause

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.

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 the rotation of the file.


Deleting the file when your tc Server instance is restarted

You can manually delete the logs/wrapper.log file when the tc Server is brought down for maintenance jobs or  when the tc Server 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.


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


Enabling the Rotation of 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 size of 10MB.

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.