VMware SmartAssurance NCM | Ncmcore localhost_access logs auto-rotation configuration
search cancel

VMware SmartAssurance NCM | Ncmcore localhost_access logs auto-rotation configuration

book

Article ID: 323793

calendar_today

Updated On:

Products

VMware

Issue/Introduction

The localhost-access logs build up on the server on daily action basis and consume a large chunk of disk-space. Hence a mechanism to delete such logs automatically post a specified retention interval is always handy to maintain the server health.


Symptoms:

This article covers details on how one can achieve auto-deletion of localhost_access logs on NCM application post a specified retention interval.


Environment

VMware Smart Assurance - NCM

Resolution

As per online reference, https://tomcat.apache.org/tomcat-9.0-doc/config/valve.html#Access_Logging, we have the setting post tomcat 9.X to auto-rotate and delete the logs which works with the user requirements.

maxDays

The maximum number of days rotated access logs will be retained for before being deleted. If not specified, the default value of -1 will be used which means never delete old files.

 

1) Backup the existing copy of $VOYENCE_HOME/ncmcore/conf/server.xml

2) Edit the $VOYENCE_HOME/ncmcore/conf/server.xml and find the entry which looks like : "org.apache.catalina.valves.AccessLogValve"

3) Add the below highlighted entry to the configuration as follows:

<!-- Access log processes all example.

  Documentation at: /docs/config/valve.html

  Note: The pattern used is equivalent to using pattern="common" -->

  <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"

    prefix="localhost_access_log" suffix=".txt" maxDays="30" 

    pattern="%h %l %u %t &quot;%r&quot; %s %b" />

Note: In this example, we have used 30 days as the retention period for the logs and this could be customized to user-requirements.

4)Initiate a vcmaster restart for the settings to take effect. 


Additional Information

This workaround is also useful for applications that make use of tomcat utility. Please raise a Service Request with VMware Support in-case you have any concerns.