Ben T
07/10/2025, 7:27 PMMarvin
07/10/2025, 7:27 PMNate
07/10/2025, 7:28 PMMarvin
07/10/2025, 7:28 PMdocker logs
, you can modify your configuration to only use console logging (which Docker captures) and the database.
Here's how to do it:
1. In your docker-compose configuration, set these environment variables for your Prefect services:
yaml
environment:
PREFECT_LOGGING_LEVEL: "INFO" # or your desired level
PREFECT_LOGGING_HANDLERS_FILE_ENABLED: "false" # disables file logging
2. If you have any volume mounts specifically for logs, you can remove them from your docker-compose.yml.
This configuration will:
- Store flow run logs in the Prefect database (which happens by default)
- Output logs to stdout/stderr (which Docker captures)
- Prevent creation of log files in the container
The logs will still be:
- Visible through docker logs
as you're currently doing
- Available in the Prefect UI
- Stored in the Prefect database
- Queryable through the Prefect API
For more detailed logging customization options, you can refer to the logging customization documentation.Nate
07/10/2025, 7:29 PMwriting logs to a mounted volume.
Ben T
07/15/2025, 8:25 PM