API Developer Portal (ADP) metrics log not rotating
search cancel

API Developer Portal (ADP) metrics log not rotating

book

Article ID: 42583

calendar_today

Updated On:

Products

CA API Developer Portal CA API Gateway

Issue/Introduction

If the API Developer Portal metrics log is enabled, under certain circumstances the portal_metrics.log file may continue to grow and will not rotate or compress.

Environment

Release:
Component: APIPRD

Cause

After a period of time, typically around 100 days, and under certain circumstances, the portal_metrics.log file may grow to well beyond 1 GB in size without rotating itself or compressing itself.

Resolution

To solve this issue, a user must follow the instructions below:

  1. Log into the API Gateway as the root account
  2. Create the file "/etc/logrotate.d/metrics" with the following contents, and then save the file.
/opt/SecureSpan/Gateway/node/default/var/logs/portal_metrics.log {
copytruncate
size 100M
rotate 10
compress
missingok
}
  • Please note as logrotate is a cron job, a restart of the appliance is not necessary.
  • The above steps will ensure that the log file rotates once it reaches 100 MB in size, and compresses the rotated file.
  • In the event where it is necessary to immediately force the rotation, the folllowing command can be run: # logrotate --force /etc/logrotate.d/metrics
  • More information on logrotate can be found here (third-party link): https://linux.die.net/man/8/logrotate