Simple Logger

Description

The Simpler Logger policy provides capability for logging with basic message output. JavaScript ES6 template literal syntax is supported.

This policy allows you to dump any and all parameters of the EG Context object.

Usage

To enable the Simple Logger policy, add log in gateway.config.yml in the policies section.


policies:
  - log

Example


pipelines:
  api:
    policies:
      simple-logger: # policy name
        - action:    # array of condition/actions objects
            message: ${req.method} ${req.originalUrl} # parameter for log action

Options Reference

  • message:
    • string specifiying the message to log
    • can include placeholders using the JavaScript [ES6 template literal syntax][es6-template-literal-sytnax]