---
schema_version: "1"
id: 03f3c5f436edc2bdad92c24d21beb679b23d2b3a4359fb5cc02189b72b0faeb5
title: Configuring Policy Logging
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/pdk/latest/policies-pdk-configure-features-logging.md
canonical_url: https://docs.mulesoft.com/pdk/latest/policies-pdk-configure-features-logging
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 893ce15f9723a54084225ef69d170337be5771639ac00f7ac4e97645d7b8cf79
description: MuleSoft Documentation Site
release: "1.10"
latest: true
---
---
product: Omni Gateway Policy Development Kit (PDK)
version: 1.10
is-latest-version: true
---

# Configuring Policy Logging

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Omni Gateway Policy Development Kit (PDK) provides a logging mechanism that generates a log message
enriched with the API instance ID, policy ID, and request ID.

Insert custom logs with the following macros by using the `pdk::logger;` package:

- `logger::debug!`

- `logger::info!`

- `logger::warn!`

- `logger::error!`

The macros behave the same as the
[Rust std::format! macro](https://doc.rust-lang.org/std/macro.format.html). The first parameter must
be a format string literal. Use `{}` in the literal to pass parameters, for example:

```Rust
use pdk::logger;

// [...]

let value = "there!";
logger::debug!("Hello there!");
logger::info!("Hello {}", value);
logger::warn!("Hello {value}");
logger::error!("Hello {}", "there!");
```

All examples appear in the Omni Gateway logs in the following format:

\[flex-gateway-envoy\]\[<log-level>\] wasm log <policy-name>.<api-instance-name> main: \[policy:
<policy-name>\]\[api: <api-instance-name>\]\[req: <request-id> \] Hello there!

For more information about viewing Omni Gateway logs, see
[Monitoring Omni Gateway](https://docs.mulesoft.com/gateway/latest/gateway-monitor).
