Documentation

Policies Reference

Log

Description

The Log 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; their

Note: The message is logged with level info; so if you want to see it, you should make sure to enable such level when starting the gateway by setting the environment variable LOG_LEVEL to info

Usage

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


policies:
  - log

Example


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

Options Reference