<@ULVA73B9P> i want to suppress prefect logs emitt...
# ask-marvin
l
@Marvin i want to suppress prefect logs emitted by the worker
m
thought for 400.4 seconds
Got it! Assuming you’re on Prefect 3.x, the simplest way to suppress logs emitted by the worker process is to raise the logging level via environment variables. Quick options: - Reduce to errors only
Copy code
export PREFECT_LOGGING_LEVEL=ERROR
prefect worker start -p <your-pool>
- Make the worker essentially silent
Copy code
export PREFECT_LOGGING_LEVEL=CRITICAL
prefect worker start -p <your-pool>
Notes: - There’s no
--log-level
flag on
prefect worker start
(confirmed via
--help
). - This changes the worker process’s console logs; it does not silence your flow/task logs in the UI. - For Docker/K8s workers, set the env var on the worker container/pod. If you want to target only the worker logger (instead of all Prefect logs), use a custom logging config: 1) Copy the default logging.yml and set the
prefect.workers
logger level to
ERROR
or
CRITICAL
. 2) Point Prefect to it with:
Copy code
export PREFECT_LOGGING_CONFIG_PATH=/path/to/your/logging.yml
prefect worker start -p <your-pool>
References: - Logging customization (Prefect 3.x) - Settings reference - Default logging.yml Would you like everything hidden (CRITICAL only), or just reduced to WARNING/ERROR? And are you running the worker locally, in Docker, or on Kubernetes?