Skip to content

Latest commit

 

History

History
48 lines (34 loc) · 1.41 KB

logging.md

File metadata and controls

48 lines (34 loc) · 1.41 KB

Logging

Configuration

Stitch uses pino logger. The logger default configuration can be found here.

Custom configuration can be provided using LOGGER_CONFIGURATION environment variable.

Note: environment variable value should be JSON-serialized object of pino.LoggerOptions type. Properties of function type aren't supported.

Example:

LOGGER_CONFIGURATION: |
  {
    "redact": [
      "err.request.headers.authorization"
    ]
  }

Logging levels

Stitch log level can be set using LOG_LEVEL environment variable. The levels are trace, debug, info, warn, error, and fatal. The default log level is warn.

Additionally there is option to set different log levels for every module. It can be done using CHILD_LOGGERS_LEVELS environment variable.

In the example:

{
  "policies-directive": "debug"
}

In this case the logger in the policies.ts module will log all that is debug level or above. All other modules will log on the level defined by LOG_LEVEL environment variable.

Existing module loggers

  • request
  • opa-rego-compiler
  • auth-strategy-api-key
  • auth-strategy-jwt
  • policies-directive
  • policy-directive
  • policy-query-directive
  • policy-executor
  • policy-argument-evaluator