Uploaded image for project: 'Commons - Audit'
  1. Commons - Audit
  2. CAUD-427

SizeBasedRotationPolicy does not delete oldest file

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 24.0.0, 25.0.0, 26.0.0
    • Fix Version/s: 26.1.0, 26.0.1, 24.0.34, 25.0.8
    • Labels:
    • Environment:
      Java 1.8.0_151-b12
      Apache Tomcat/8.0.48
      AM 5.1.1
    • Support Ticket IDs:

      Description

      Configure the following retention policy for the global AM JSON audit handler

      rotationInterval=-1
      rotationTimes=
      bufferingMaxSize=100000
      topics=access
      topics=activity
      topics=config
      topics=authentication
      rotationEnabled=true
      retentionMinFreeSpaceRequired=-1
      enabled=true
      handlerFactory=org.forgerock.openam.audit.events.handlers.JsonAuditEventHandlerFactory
      retentionMaxNumberOfHistoryFiles=10
      retentionMaxDiskSpaceToUse=100000
      rotationFileSuffix=-yyyy.MM.dd-HH.mm.ss
      bufferingWriteInterval=5
      rotationMaxFileSize=25000
      location=%BASE_DIR%/%SERVER_URI%/log/
      rotationFilePrefix=
      elasticsearchCompatible=false
      rotationRetentionCheckInterval=5
      

      When 'bufferingMaxSize' is reached, then the current audit log file is deleted/flushed as can be seen from the following output which gathered the file sizes via shell

      while true; do echo "------- `date +%Y%m%d-%H%M%S` -------------"; ls -l access*; sleep 5; done
      
      ------- 20180226-163059 -------------
      ------- 20180226-163059 -------------
      -rw-r--r--  1 am  service   9315 Feb 26 16:19 access.audit.json
      -rw-r--r--  1 am  service  33075 Feb 26 16:13 access.audit.json-2018.02.26-16.13.44
      -rw-r--r--  1 am  service  34902 Feb 26 16:16 access.audit.json-2018.02.26-16.16.41
      -rw-r--r--  1 am  service  27267 Feb 26 16:18 access.audit.json-2018.02.26-16.18.00
      ------- 20180226-163104 -------------
      -rw-r--r--  1 am  service  15023 Feb 26 16:31 access.audit.json
      -rw-r--r--  1 am  service  33075 Feb 26 16:13 access.audit.json-2018.02.26-16.13.44
      -rw-r--r--  1 am  service  34902 Feb 26 16:16 access.audit.json-2018.02.26-16.16.41
      -rw-r--r--  1 am  service  27267 Feb 26 16:18 access.audit.json-2018.02.26-16.18.00
      ------- 20180226-163109 -------------
      -rw-r--r--  1 am  service  21102 Feb 26 16:31 access.audit.json
      -rw-r--r--  1 am  service  33075 Feb 26 16:13 access.audit.json-2018.02.26-16.13.44
      -rw-r--r--  1 am  service  34902 Feb 26 16:16 access.audit.json-2018.02.26-16.16.41
      -rw-r--r--  1 am  service  27267 Feb 26 16:18 access.audit.json-2018.02.26-16.18.00
      ------- 20180226-163114 -------------
      -rw-r--r--  1 am  service  23065 Feb 26 16:31 access.audit.json
      -rw-r--r--  1 am  service  33075 Feb 26 16:13 access.audit.json-2018.02.26-16.13.44
      -rw-r--r--  1 am  service  34902 Feb 26 16:16 access.audit.json-2018.02.26-16.16.41
      -rw-r--r--  1 am  service  27267 Feb 26 16:18 access.audit.json-2018.02.26-16.18.00
      ------- 20180226-163119 -------------
      -rw-r--r--  1 am  service  23065 Feb 26 16:31 access.audit.json
      -rw-r--r--  1 am  service  33075 Feb 26 16:13 access.audit.json-2018.02.26-16.13.44
      -rw-r--r--  1 am  service  34902 Feb 26 16:16 access.audit.json-2018.02.26-16.16.41
      -rw-r--r--  1 am  service  27267 Feb 26 16:18 access.audit.json-2018.02.26-16.18.00
      ------- 20180226-163124 -------------
      -rw-r--r--  1 am  service   3487 Feb 26 16:31 access.audit.json
      -rw-r--r--  1 am  service  33075 Feb 26 16:13 access.audit.json-2018.02.26-16.13.44
      -rw-r--r--  1 am  service  34902 Feb 26 16:16 access.audit.json-2018.02.26-16.16.41
      -rw-r--r--  1 am  service  27267 Feb 26 16:18 access.audit.json-2018.02.26-16.18.00
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              markdr Mark de Reeper
              Reporter:
              bthalmayr Bernhard Thalmayr
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: