Skip to content

Configuration

You can configure Logfire in several ways:

  1. Programmatically via [logfire.configure()][logfire.configure]

  2. use environment variables

  3. Use profile (pyproject.toml)

The priorities are as described above.

Programmatically via configure

For more details, please refer to our API documentation [logfire.configure].

use environment variables

You can configureLogfireusing the following environment variables:

{{ env_var_table }}

When using environment variables, you still need to call logfire.configure() , but you can omit arguments.

Use profile (pyproject.toml)

you can use pyproject.toml to configure Logfire。

Here is an example:

[tool.logfire]
project_name = "My Project"
console_colors = "never"

key and logfire.configure() The parameters are the same.


本文总阅读量次