Retain troubleshooting logs

The logs in the Troubleshooting Logs page are stored in the Secure Private Access database for 90 days. If the total log count becomes too large, for example over 100,000, you can delete the oldest logs earlier than 90 days. The clean-up job, by default, runs every 12 hours. The job also runs whenever the runtime service restarts.

Customizing the troubleshooting logs retention settings

The cleanup of the logs is configurable through the appsettings.json file in the Runtime service’s installation folder. You can set the cleanup based on the age of the logs and the number of logs that can be stored in the database. Modify the following entries in the appsettings.json file, as required:

Sample appsettings.json file:

  "TroubleshootingLogs": {
    "CleanupPeriodInHours": 12,
    "CleanupDataOlderThanDays": 90,
    "CleanupOldestDataIfEntriesCountAbove": 100000
  }
<!--NeedCopy-->

To disable cleanup, configure the following settings as required:

  • To retain logs for 7 days only, set CleanupDataOlderThanDays to 7.
  • To disable the days-based cleanup, set CleanupDataOlderThanDays to 0.
  • To disable the count-based cleanup, set CleanupOldestDataIfEntriesCountAbove to 0.
  • If both of these settings are set to 0, or if CleanupPeriodInHours is set to 0, the logs are retained forever.

    • Setting both CleanupDataOlderThanDays or CleanupOldestDataIfEntriesCountAbove to 0 or setting CleanupPeriodInHours to 0 is not recommended as it might cause 100% disk usage issue.
    • The logs cleanup frequency can also be changed by modifying the CleanupPeriodInHours entry.

Note:

If Secure Private Access is deployed as a cluster, then these settings must be modified in each cluster node. If there is a mismatch in the node settings, the instance that is cleaned up most frequently takes precedence.

Retain troubleshooting logs