Common Logging Config for all routes

This topic has 2 replies, 2 voices, and was last updated 4 years, 10 months ago by chris-fry.

  • Author
    Posts
  • #19676
     chris-fry
    Participant

    Hi,

    Is there a way to create an an AuditService configuration that applies to all routes without specifying it in each individual route?

    I’ve been able to create a named audit service in the heap and include that in each route, but I’d rather just have it on for all routes without needing to be consciously included each time.

    Here’s the config.json I’ve been trying to get to do this:

    {
      "handler": {
        "type": "Router",
        "name": "_router",
        "capture": "all"
      },
      "auditService": {
        "type": "AuditService",
        "config": {
          "config": {},
          "event-handlers": [
            {
              "class": "org.forgerock.audit.handlers.json.JsonAuditEventHandler",
              "config": {
                "logDirectory": "/var/log/openig",
                "topics": [
                  "access"
                ]
              }
            }
          ]
        }
      },
      "heap": [
        {
          "name": "capture",
          "type": "CaptureDecorator",
          "config": {
            "captureEntity": true,
            "_captureContext": true
          }
        }
      ]
    }

    Am I missing something/is there a better approach?

    – Chris

    #19686

    You can share an audit service:

    Just create it once in your config.json, and then reference it in your routes using its name.

    #19707
     chris-fry
    Participant

    Hi Guillaume,

    So, just use a named audit service configuration in the heap and refer to it in each route? I have done this, but I was hoping to have it set by default to avoid configuration duplication.

    – Chris

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

©2022 ForgeRock - we provide an identity and access platform to secure every online relationship for the enterprise market, educational sector and even entire countries. Click to view our privacy policy and terms of use.

Log in with your credentials

Forgot your details?