Skip to content

Commit

Permalink
Merge pull request #242 from permitio/daniel/docs
Browse files Browse the repository at this point in the history
First version of the Debug Mode docs
  • Loading branch information
danielbass37 authored Mar 18, 2024
2 parents 1e638f0 + 3180db8 commit 2870979
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/how-to/use-audit-logs/_category_.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"label": "Use Audit Logs",
"label": "Audit Logs",
"position": 3,
"link": {
"type": "generated-index",
Expand Down
57 changes: 57 additions & 0 deletions docs/how-to/use-audit-logs/debug-mode.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
sidebar_position: 3
title: Debug Mode
---

Knowing why some decisions were made by your PDP can be a crutial part of buidling and understanding your policies, especially when you encounter unexpected results.
That's what **Debug Mode** is here for.

##What is Debug mode?

Permit's Debug Mode adds additional debug information to your decision logs, allowing for an in-depth analysis of the decisions made by your [PDP](https://docs.permit.io/concepts/pdp).

##The advantages of Debug Mode

On top of standard log information provided by our Audit Logs, Debug Mode allows us to understand -

- Why a decision was made
- Which policy was taken into consideration for the evaluation process
- What are the policies currently configured in your environment

This information gives you a more granular understanding of any decision made by the PDP.

:::warning
Turning on Debug Mode will impact policy evaluation latency. Thus, it is recommended to disable Debug Mode when running in production.
:::

##Activating Debug Mode

There are two possible ways to activate Debug Mode:

###Through the PDP environment variables:

When running your PDP, set the environment variable `PDP_DEBUG=True` as part of the PDP deployment.
This will activate Debug Mode for this specific PDP.

Here's an example of such a PDP deployment:

```
docker run -it \
-p 7766:7000 \
--env PDP_API_KEY=<YOUR_API_KEY> \
--env PDP_DEBUG=True
permitio/pdp-v2:latest
```

:::note
This configuration will only enable Debug Mode in the PDP itself and not across your environment.
:::

### Through the UI (Coming Soon)

Another option to enable Debug Mode is through Permit's UI. To do that:

1. Go to your Permit dashboard and make sure you have the relevant project and environment selected.
2. Next, go to the **Audit Log** screen.
3. In the top right corner, click on **Settings**.
4. Click the toggle to enable Debug Mode.
2 changes: 1 addition & 1 deletion docs/how-to/use-audit-logs/troubleshooting.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 3
sidebar_position: 4
title: Troubleshooting
---

Expand Down

0 comments on commit 2870979

Please sign in to comment.