How to limit the number of Catalina_Base logs?

book

Article ID: 129805

calendar_today

Updated On:

Products

CA Service Management - Asset Portfolio Management CA Service Management - Service Desk Manager

Issue/Introduction

CA Service Desk/CMDB uses a Catalina instance for its web interface and other operations. As a result, there will be one file catalina.YYYY-MM-DD.log per day created in the Catalina_Base\logs folder and over time, the number of files will grow and the disk space will be taken, though old files have no much values anymore. This will cause some issues if too many files stay here and system administrator or Service Desk administrator would need to remove them manually. User would like to configure something to limit the number of log files.

How to limit the number of Catalina_Base logs?

Environment

CA Service Desk/CMDB 14.1, 17.1, 17.2 on Windows, Linux/Unix

Resolution

Those files can't be configured to limit days or sizes and user would need to manually remove them. This process could be automated via some schedule jobs with batch or shell script. For example, on Linux/Unix, use something like
#!/bin/sh
find $CATALINA_BASE/logs -name 'catalina.*.log' -mtime +1w -print0 | xargs -0 rm -f