You can use the following ways to configure Logfire:
- Programmatically via [
logfire.configure()
][logfire.configure] - Using environment variables
- Using a configuration file (
pyproject.toml
)
The order of precedence is as above.
For more details, please refer to our [API documentation][logfire.configure].
You can use the following environment variables to configure Logfire:
{{ env_var_table }}
When using environment variables, you still need to call [logfire.configure()
][logfire.configure],
but you can leave out the arguments.
You can use the pyproject.toml
to configure Logfire.
Here's an example:
[tool.logfire]
project_name = "My Project"
console_colors = "never"
The keys are the same as the parameters of [logfire.configure()
][logfire.configure].