Skip to main content

Log

Overview

The Log policy action allows you to leverage ngrok's eventing system to introduce observability into your traffic policy.

Example

Use this action config in your Traffic Policy

# snippet
---
actions:
- type: "log"
config:
metadata:
message: "Invalid TLS Version"
edge_id: "edghts_2bhsN2VP8W4pTkaMSrhyj0SRf8J"
edge_route_id: "edghtsrt_2bhsN5u05QQ1MRrI3XbpDQMFSE7"

Request:

curl https://example.ngrok.app/api/v1

Result:

Behavior

When this action is executed, the specified metadata will be collected on the http_request_complete.v0 event under traffic_policy.logs.

Reference

Supported Directions

  • Inbound
  • Outbound

Configuration

Type
log
Parameter Description
metadataMap<string, any>A map of metadata that you would like to be included in the details of your log event.

Action Result Variables

The following variables are available following the invocation of this action.

NameTypeDescription
actions.ngrok.log.metadatamap[string]stringThe key value map of the metadata values.