Sophia Ponte
06/27/2025, 10:06 PMMarvin
06/27/2025, 10:06 PMMarvin
06/27/2025, 10:07 PMbash
export PREFECT_LOGGING_LEVEL="DEBUG" # Or INFO, WARNING, ERROR
prefect server start
2. Using the Prefect settings interface:
bash
prefect config set PREFECT_LOGGING_LEVEL="DEBUG"
3. For more granular control, you can set specific logger levels:
bash
export PREFECT_LOGGING_SERVER_LEVEL="DEBUG" # Controls server-specific logging
export PREFECT_LOGGING_LEVEL="INFO" # Controls general Prefect logging
The available log levels, from most to least verbose, are:
- DEBUG
- INFO (default)
- WARNING
- ERROR
- CRITICAL
For more advanced logging customization options, including how to format logs or direct them to specific outputs, you can refer to the logging customization documentation.Sophia Ponte
06/27/2025, 10:09 PMMarvin
06/27/2025, 10:09 PMMarvin
06/27/2025, 10:09 PMyaml
server:
env:
- name: PREFECT_LOGGING_LEVEL
value: "DEBUG" # Or INFO, WARNING, ERROR as needed
- name: PREFECT_LOGGING_SERVER_LEVEL
value: "DEBUG" # Specifically for server logs
2. Using Helm install/upgrade command:
bash
helm upgrade --install prefect prefecthq/prefect-server \
--set server.env[0].name=PREFECT_LOGGING_LEVEL \
--set server.env[0].value=DEBUG
3. Via a custom ConfigMap:
yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: prefect-server-config
data:
PREFECT_LOGGING_LEVEL: "DEBUG"
PREFECT_LOGGING_SERVER_LEVEL: "DEBUG"
---
# Reference this ConfigMap in your values.yaml
server:
envFrom:
- configMapRef:
name: prefect-server-config
After making these changes, you'll need to restart the Prefect server pods for the new logging configuration to take effect:
bash
kubectl rollout restart deployment prefect-server
Available log levels (from most to least verbose):
- DEBUG
- INFO (default)
- WARNING
- ERROR
- CRITICAL
For more advanced logging configurations, you can also provide a custom logging.yml
file through a ConfigMap and mount it to the server pods. This gives you complete control over the logging configuration, including formatters and handlers.
Remember that setting very verbose logging levels (like DEBUG) in production environments can impact performance and generate large amounts of logs, so use appropriate levels based on your needs.