# Configuration

Python

> **Note**
>
> **Probe Lifecycle**
>
> Blackfire Probes follow a 180-day decommissioning policy: A specific Probe version remains supported for 180 days after a newer version is released, or 180 days after its upstream runtime reaches end-of-life.
>
> - [View the full deprecation policy](../up-and-running/deprecation-policy)
> - [Go to the upgrade guide](../up-and-running/update)

## Configuring the Probe via Environment Variables

The preferred way to configure the Python probe is via environment variables. That allows you to change the configuration without modifying your code:

- `BLACKFIRE_CLIENT_ID` / `BLACKFIRE_CLIENT_TOKEN`

    Sets the client ID and client Token used to authenticate with Blackfire.
- `BLACKFIRE_LOG_LEVEL`

    Sets the verbosity of the Probe's log output. Default value is `1` (error).

    ```bash
    # 1: error
    # 2: warning
    # 3: info
    # 4: debug
    BLACKFIRE_LOG_LEVEL=1
    ```
- `BLACKFIRE_LOG_FILE`

    Defines where the output of the probe logs is sent. Default value is empty.

    ```bash
    BLACKFIRE_LOG_FILE="/tmp/probe.log"
    ```
- `BLACKFIRE_AGENT_SOCKET`

    Defines which socket the Probe contacts the Agent on. Possible values can be a Unix socket or a TCP address.

    The default value is platform dependent, as detailed below.

    On Linux:

    ```bash
    BLACKFIRE_AGENT_SOCKET="unix:///var/run/blackfire/agent.sock"
    ```

    On macOS:

    ```bash
    # amd64
    BLACKFIRE_AGENT_SOCKET="unix:///usr/local/var/run/blackfire-agent.sock"
    
    # arm64 (M1)
    BLACKFIRE_AGENT_SOCKET="unix:///opt/homebrew/var/run/blackfire-agent.sock"
    ```

    On Windows:

    ```bash
    BLACKFIRE_AGENT_SOCKET="tcp://127.0.0.1:8307"
    ```
- `BLACKFIRE_ENDPOINT`

    Defines which API endpoint the profile data is sent to.

    ```bash
    BLACKFIRE_ENDPOINT="https://blackfire.io"
    ```
- `BLACKFIRE_APM_ENABLED`

    Enables or disables Blackfire Monitoring.

    ```bash
    BLACKFIRE_APM_ENABLED=1
    ```
- `BLACKFIRE_APM_ENABLE_AUTOMATIC_BROWSER_PROBE`

    Controls Front-end Observability tracking snippet injection.

    ```bash
    BLACKFIRE_APM_ENABLE_AUTOMATIC_BROWSER_PROBE=1
    ```
- `BLACKFIRE_SERVER_ID` / `BLACKFIRE_SERVER_TOKEN`

    Sets the server ID and server Token used to authenticate with Blackfire. This is optional. Prefer configuring your server credentials in the Agent.

You can set these environment variables in the local `.env` file of your project if supported. Alternatively, you can set them in your global shell configuration file (such as `~/.bashrc` or `~/.zshrc`):

```bash
export BLACKFIRE_CLIENT_ID=xxx
export BLACKFIRE_CLIENT_TOKEN=yyy
export BLACKFIRE_LOG_LEVEL=4
export BLACKFIRE_LOG_FILE=/tmp/probe.log
```

## Configuring the Probe via the Blackfire CLI Client Configuration File

When environment variables are not set, the probe reads its default configuration from the configuration of the Blackfire CLI client. The location of this file depends on the operating system you use. [Read more about the CLI configuration](../up-and-running/configuration/cli).

## Configuring the Probe via Python Code

You can also configure the probe from your [Python code](../python/integrations/sdk#probe-configuration-python).
