ALERT: Some images may not load properly within the Knowledge Base Article. If you see a broken image, please right-click and select 'Open image in a new tab'. We apologize for this inconvenience.

How can agent logs be rolled over by date?

book

Article ID: 200442

calendar_today

Updated On:

Products

CA Application Performance Management Agent (APM / Wily / Introscope) CA Application Performance Management (APM / Wily / Introscope) INTROSCOPE DX Application Performance Management

Issue/Introduction

The doc section Roll Up Logs by Date or Size in https://techdocs.broadcom.com/us/en/ca-enterprise-software/it-operations-management/application-performance-management/20-2/implementing-agents/java-agent/configure-java-monitoring/java-agent-logging.html indicates logs can be rolled over based on date as well as size but gives no example.  Is rollover by date possible and if so how is it configured? 

Environment

Application Performance Management 20.2

Resolution

To implement daily log rotation change the following property values in the agent profile. This has been verified in Java agent and Infrastructure Agent

modify 

log4j.appender.logfile=com.wily.introscope.agent.AutoNamingRollingFileAppender

to
 
log4j.appender.logfile=com.wily.org.apache.log4j.DailyRollingFileAppender


the logs will then rollover at midnight as in the following example
-rw-r--r--. 1 root root 2928 Sep 28 02:58 IntroscopeAgent.log
-rw-r--r--. 1 root root 1654321 Sep 25 23:59 IntroscopeAgent.log.2020-09-25
-rw-r--r--. 1 root root 23104 Sep 26 23:59 IntroscopeAgent.log.2020-09-26
-rw-r--r--. 1 root root 23104 Sep 27 23:59 IntroscopeAgent.log.2020-09-27
Note: When using this mechanism the parameters that control the log file size i.e.
 

log4j.appender.logfile.MaxBackupIndex=4

log4j.appender.logfile.MaxFileSize=20MB

are no longer used so the log file size may grow 


A documentation change request has been raised for an example to be included in the standard documentation