Skip to content
This repository has been archived by the owner on Jan 15, 2022. It is now read-only.

Latest commit

 

History

History
99 lines (74 loc) · 2.42 KB

cli-logging-configuration.md

File metadata and controls

99 lines (74 loc) · 2.42 KB

Log Management

To view/update logging configuration, let's get the information of logging Configuration.

/opt/jans/jans-cli/config-cli.py --info ConfigurationLogging

Operation ID: get-config-logging
  Description: Returns Jans Authorization Server logging settings.
Operation ID: put-config-logging
  Description: Updates Jans Authorization Server logging settings.
  Schema: /components/schemas/LoggingConfiguration

To get sample shema type /opt/jans/jans-cli/config-cli.py --schema <schma>, for example /opt/jans/jans-cli/config-cli.py --schema /components/schemas/LoggingConfiguration

Table of Contents

Find Logging Configuration

/opt/jans/jans-cli/config-cli.py --operation-id get-config-logging

Getting access token for scope https://jans.io/oauth/config/logging.readonly
{
  "loggingLevel": "INFO",
  "loggingLayout": "text",
  "httpLoggingEnabled": false,
  "disableJdkLogger": true,
  "enabledOAuthAuditLogging": false,
  "externalLoggerConfiguration": null,
  "httpLoggingExludePaths": null
}

Update Logging Configuration

To update logging configuration, get the schema first:

/opt/jans/jans-cli/config-cli.py --schema /components/schemas/LoggingConfiguration > /tmp/log-config.json


{
  "loggingLevel": "FATAL",
  "loggingLayout": "text",
  "httpLoggingEnabled": true,
  "disableJdkLogger": true,
  "enabledOAuthAuditLogging": false,
  "externalLoggerConfiguration": null,
  "httpLoggingExludePaths": [
    "/auth/img",
    "/auth/stylesheet"
  ]
}

let's update the schema:

nano /tmp/log-config.json

Here I have updated loggingLevel to DEBUG and enabledOAuditLogging to true as below image.

updated logging

Let's do the operation:

/opt/jans/jans-cli/config-cli.py --operation-id put-config-logging --data /tmp/log-config.json

You will get the updated result as below:


Getting access token for scope https://jans.io/oauth/config/logging.write
Server Response:
{
  "loggingLevel": "DEBUG",
  "loggingLayout": "json",
  "httpLoggingEnabled": false,
  "disableJdkLogger": false,
  "enabledOAuthAuditLogging": true,
  "externalLoggerConfiguration": null,
  "httpLoggingExludePaths": [
    "/auth/img",
    "/auth/stylesheet"
  ]
}