An Access Gateway Web Agent is using the following trace log settings, with rotation and retention working as expected, however, once every two months or so the trace log will fail to rotate and instead continues to grow until the disk is full or Access Gateway is restarted:
traceappend=no
traceconfigfile=CA Access Gateway_Installed _location\CA\secure-proxy\proxy-engine\conf\defaultagent\SecureProxyTrace.conf
tracefile=yes
tracefilename=CA Access Gateway_Installed _location\log\trace.log (Basically specify the file name)
tracefilesize=25
tracefilestokeep=10
Component: CA Access Gateway (SMSPS)
Release: Applicable to all the supported releases on Windows
Another process or program has a lock on the file, preventing CA Access Gateway from renaming the log file to rotate it.
Use Windows Resource Monitor (accessed via Task Manager) to discover which process/program has a lock on the log file and remove the lock.
Find a way to prevent the process/program from locking the file when Access Gateway is running.
In this particular example where log rotation is based on size, it's typically not possible to predict when a log rotation may occur.