Log4j configuration not removing old log files in SPS
search cancel

Log4j configuration not removing old log files in SPS

book

Article ID: 383167

calendar_today

Updated On:

Products

SITEMINDER CA Single Sign On Secure Proxy Server (SiteMinder)

Issue/Introduction


Running CA Access Gateway (SPS), this one doesn't remove the old log file server.log and proxyui.log, and keep more than 10 files.

The amount of the rotated log files gets always higher.

 

Cause


Reading the configuration file, note that the strategy.max is applied by date only:

/{home_sps}/Tomcat/properties/logger.properties:

  # strategy max as 10 indicates that the rollover log file is suffixed with
  #   the date and there will be a maximum 10 files for each day. 

To validate that, set logger.properties that way for the server.log:

  appender.SvrFileAppender.policies.size.type = SizeBasedTriggeringPolicy
  appender.SvrFileAppender.policies.size.size = 2KB
  appender.SvrFileAppender.policies.OnStartup.type = OnStartupTriggeringPolicy
  appender.SvrFileAppender.strategy.type = DefaultRolloverStrategy
  appender.SvrFileAppender.strategy.max = 2

Then, only 2 files with a size not exceeding 2K will be created by day, even if many times a restart of the CA Access Gateway (SPS) happens.

 

Resolution


Configure the logger.properties file to retain the amount of files wanted daily, and use an external script to archive the files from past days, to keep only the daily log files in the log folder.