Daniel Boschbach
09/26/2025, 9:08 PMkopf.objects - Handler '_replicate_pod_event' succeeded.
20:51:48.825 | INFO | kopf.objects - Handler '_mark_flow_run_as_crashed' succeeded
Marvin
09/26/2025, 9:08 PMMarvin
09/26/2025, 9:14 PMPREFECT_LOGGING_ROOT_LEVEL=WARNING
PREFECT_LOGGING_LOGGERS_prefect_LEVEL=INFO
This reduces most third‑party INFO logs while keeping Prefect logs at INFO.
Option B — Only suppress Kopf logs
- Set the Kopf logger(s) to WARNING:
PREFECT_LOGGING_LOGGERS_kopf_LEVEL=WARNING
PREFECT_LOGGING_LOGGERS_kopf.objects_LEVEL=WARNING
If your image/version doesn’t pick up the per-logger env var overrides, use a small logging YAML and point Prefect to it:
1) Create logging.yml:
version: 1
disable_existing_loggers: false
loggers:
kopf:
level: WARNING
propagate: true
kopf.objects:
level: WARNING
propagate: true
prefect:
level: INFO
propagate: true
root:
level: WARNING
handlers: [console]
2) Mount it into the worker pod (e.g., via a ConfigMap) and set:
PREFECT_LOGGING_SETTINGS_PATH=/etc/prefect/logging.yml
Docs:
- Prefect 3 logging customization
- Kubernetes worker guide
Would you prefer to just suppress the logs or disable the Kubernetes observer entirely? If you want to disable it, let me know your Prefect and prefect-kubernetes versions (and the worker image you’re using) and I’ll share the exact setting for your version.Daniel Boschbach
09/29/2025, 2:19 PMPREFECT_LOGGING_ROOT_LEVEL=WARNING
PREFECT_LOGGING_LOGGERS_prefect_LEVEL=INFO
This reduces most third‑party INFO logs while keeping Prefect logs at INFO.
Option B — Only suppress Kopf logs
- Set the Kopf logger(s) to WARNING:
PREFECT_LOGGING_LOGGERS_kopf_LEVEL=WARNING
PREFECT_LOGGING_LOGGERS_kopf.objects_LEVEL=WARNING
produce still this kopf.objects
log entries. How can they be suppressed?Marvin
09/29/2025, 2:22 PMMarvin
09/29/2025, 2:37 PMPREFECT_LOGGING__ROOT__LEVEL=WARNING
PREFECT_LOGGING__LOGGERS__prefect__level=INFO
- Option B (suppress Kopf logs, including the dotted child logger)
PREFECT_LOGGING__LOGGERS__kopf__level=WARNING
PREFECT_LOGGING__LOGGERS__kopf__objects__level=WARNING
# If Kopf attaches its own handlers, also stop propagation:
PREFECT_LOGGING__LOGGERS__kopf__propagate=false
PREFECT_LOGGING__LOGGERS__kopf__objects__propagate=false
Tips to validate:
- In your worker pod, run:
prefect config view --show-sources --show-defaults | grep -i logging
to confirm Prefect is picking up your env vars.
- Ensure your env var names don’t contain a literal “.” — Kubernetes env var names and shells won’t accept dots, and Prefect won’t parse them.
If you still see kopf.objects
logs after the above, they may not be coming from the Prefect worker process (e.g., another operator in the cluster is emitting them). In that case, Prefect can’t suppress them; you’d need to filter at your log collector/aggregation layer.
For more details and alternative via a logging YAML (with PREFECT_LOGGING_SETTINGS_PATH
), see Prefect 3 logging customization.