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=C:\Program Files\CA\secure-proxy\proxy-engine\conf\defaultagent\SecureProxyTrace.conf
tracefile=yes
tracefilename=D:\Logs\AccessGateway\agent_trace.log
tracefilesize=25
tracefilestokeep=10
Access Gateway - all supported releases on Windows
Another process or program has a lock on the file, preventing 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.