Using Logfire Environments
Learn how to manage different environments in Logfire with a single line of code
- Product
- Pydantic
- Sent from
- pydantic.dev
- Sent
No dark-mode styles — this email renders the same in a dark client.
Logfire
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Hello again!
In Logfire you can differentiate between dev/staging/prod data by adding one line.
Set the environment parameter in logfire.configure ( https://logfire.pydantic.dev/docs/reference/api/logfire/#logfire.configure(environment) ). Here's a minimal example you can copy and run:
import logfire
logfire.configure(environment='local')
logfire.info("environment active")
When you run this, you create an environment which can be selected from the Logfire UI on the Live View, Dashboards and Explore views, allowing you to filter by that environment:
Environment selection in Logfire UI
For more details of how this feature works, see the environments documentation ( https://logfire.pydantic.dev/docs/guides/advanced/environments/ ).
Still have questions? Feel free to get in touch ( https://logfire.pydantic.dev/docs/help/ ) or just reply to this email.
Best,
Samuel
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Pydantic Services, Inc. ・
https://pydantic.dev ・
github/pydantic ( https://github.com/pydantic )
Unsubscribe ( https://track.customer.io/unsubscribe/dgSI0QoAAMmABMiABAGhzIW2NtHhe68lWpLOUxU= ) or manage your tracking preferences ( https://track.customer.io/tracking_consent/dgSI0QoAAMmABMiABAGhzIW2NtHhe68lWpLOUxU= )- Accession
- nse/pydantic/2026-11-11/6729
- From
- Pydantic Team · hello@pydantic.dev
- Sent
- 11 November 2026 · 21:00 UTC










