Uploaded image for project: 'OpenIG'
  1. OpenIG
  2. OPENIG-813

auditService : fileRotation may overwrite existing audit file

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 4.0.0, 5.0.0, 5.5.0, 5.5.1, 6.0.0, 6.1.0, 6.5.0
    • Fix Version/s: None
    • Component/s: Audit
    • Environment:
      Environment
      OS : Osx 10.11.1
      container : Tomcat 8.0.23
      jdk : 1.8.0_60
    • Sprint:
      OpenIG Sprint 74

      Description

      When an audit file has to be generated (due for example to the file size), and the rotationFileSuffix makes the file to be generated have the same name as an already generated file, the "previous" file is then overwritten and lost.

      Example with the following route

      {
          "MyCapture": "all", 
          "auditService": {
              "config": {
                  "config": {}, 
                  "enabled": true, 
                  "event-handlers": [
                      {
                          "class": "org.forgerock.audit.handlers.csv.CsvAuditEventHandler", 
                          "config": {
                              "buffering": {
                                  "autoFlush": true, 
                                  "enabled": true
                              }, 
                              "fileRotation": {
                                  "maxFileSize": 1500, 
                                  "rotationEnabled": true, 
                                  "rotationFilePrefix": "prefix-", 
                                  "rotationFileSuffix": "_yyyy-MM-dd", 
                                  "rotationTimes": [
                                      "2 hours"
                                  ]
                              }, 
                              "logDirectory": "/tmp/20151218-102442/Audit/openig/log_and_captures/audit_app1", 
                              "name": "csv", 
                              "topics": [
                                  "access"
                              ]
                          }
                      }
                  ]
              }, 
              "name": "audit-service", 
              "type": "AuditService"
          }, 
          "condition": "${matches(request.headers['test_id'][0], '^audit_app1')}", 
          "handler": {
              "config": {
                  "entity": "Message from Router defined in audit_app1.", 
                  "reason": "found", 
                  "status": 200
              }, 
              "type": "StaticResponseHandler"
          }
      }
      

      Proposed solution : add another file suffix like being an interger

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jcdevil Jean-Charles Deville
                Reporter:
                jcdevil Jean-Charles Deville
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: