Skip to main content

Troubleshoot missing audit logs

Find and fix the reason your permission checks don't appear on the Audit Log screen of the Permit dashboard. This page is for developers who run permit.check() and expect to see the decisions in Permit.

Causes of missing audit logs

CauseHow to confirmFix
The dashboard shows a different environment than the one your policy decision point (PDP) uses.The environment selector in the dashboard differs from the environment of the API key your PDP runs with.Select the PDP's environment.
Your app doesn't send checks to a PDP.Your app's logs show no permit.check() calls, or the calls fail.Connect your app to the PDP.
The PDP container isn't running.docker ps doesn't list a permitio/pdp-v2 container.Start the PDP container.
The PDP runs with decision log uploads turned off.The PDP runs with PDP_OPA_DECISION_LOG_ENABLED=False.Turn on decision log uploads.
A filter on the Audit Log screen hides the entries.Filters are set at the top of the Audit Log screen.Clear the filters.

Select the environment your PDP uses

The Audit Log screen shows the decisions of the active environment only. Each PDP belongs to the environment of the API key it runs with.

  1. Open the Projects page in the Permit dashboard.
  2. Find the environment that matches your PDP's API key, and click Set as active environment.
  3. Open the Audit Log screen again.

To find the API key of an environment, see Get your API key.

Connect your app to the PDP

An audit log entry exists only for a check that reaches a PDP. Confirm that your app does these things:

  1. Installs the latest version of the Permit SDK.
  2. Initializes the SDK with the pdp option set to your PDP's address, and the token option set to the API key of the same environment as the PDP.
  3. Calls permit.check() with a user, an action, and a resource.

For the full setup, see Connect your app and run your first permission check. For the arguments of permit.check(), see Check permissions with permit.check().

Start the PDP container

When your app uses a container PDP and the container isn't running, checks don't reach a PDP, and no decision is logged.

  1. Run docker ps. A running PDP shows a container from the permitio/pdp-v2 image.
  2. If the list has no PDP container, start one with your environment API key. See Run the PDP.
  3. Open http://localhost:7766/health. A healthy PDP returns HTTP 200.

Turn on decision log uploads

The PDP uploads decision logs to Permit while PDP_OPA_DECISION_LOG_ENABLED is True, which is the default. When the variable is False, the Audit Log screen shows no decisions from that PDP. Remove the variable or set it to True, then restart the container. See PDP configuration.

Clear the audit log filters

A filter by user, date, decision, or tenant hides the entries that don't match it. To remove the filters, refresh the Audit Log page. For how filters work, see Filter audit logs.

Confirm that audit logs appear

  1. Run one permit.check() call from your app.
  2. Open the Audit Log screen with the PDP's environment active.

The screen lists the check with its user, action, resource, and decision.

Next steps