PingAuthorize

Enabling JSON formatting for Policy Editor logs

Enable JSON-formatted data for default Policy Editor loggers.

About this task

You can add the dropwizard-json-logging library in the PingAuthorize-PAP/config/configuration.yml file for each logger you wish to enable JSON formatting for. The availability of this library does not impact the Policy Editor’s default configuration.

Steps

  1. Stop the Policy Editor.

    $ bin/stop-server
  2. In the PingAuthorize-PAP/config/configuration.yml file, add the following to the appenders section of each logger for which you want to enable JSON formatting:

    layout:
      type: json

    Example:

    To enable JSON-formatted data in management-audit.log:

    ADMIN_POINT_AUDIT:
      level: "INFO"
      additive: false
      appenders:
      - type: "file"
        layout:
          type: json
        currentLogFilename: "logs/management-audit.log"
        archive: false
        archivedLogFilenamePattern: "logs/management-audit.%i.log.gz"
        archivedFileCount: 10
        logFormat: "[%date{ISO8601}] %msg%n"
  3. To enable JSON formatting for all HTTP request log messages, add the following to the server section of the PingAuthorize-PAP/config/configuration.yml file:

    requestLog:
      appenders:
        - type: console
          layout:
            type: access-json
  4. Save your changes and restart the Policy Editor.

    $ bin/start-server