oleander-whirlwind
04/22/2026, 8:22 AMMarvin
04/22/2026, 8:22 AMMarvin
04/22/2026, 8:24 AM_queue.Empty in those DEBUG lines is expected and not an error.
What you’re seeing
- In Prefect 3.x, the API log worker polls an internal queue to batch/send logs to the API. When there’s nothing to pick up before the batch interval expires (default ~2s), queue.get(timeout=...) times out and raises queue.Empty.
- That exception is caught internally and used to flush whatever is in the batch (possibly nothing) and continue. It repeats on the next interval — hence the periodic _queue.Empty at ~2s in your snippet.
- It’s only visible because internal logging is at DEBUG. It does not indicate a problem unless you also see errors like “failed to send logs” or HTTP errors from create_logs.
If you want to reduce this noise
- Raise the internal logging level:
export PREFECT_LOGGING_INTERNAL_LEVEL=ERROR
- Or keep your general logs less chatty:
export PREFECT_LOGGING_LEVEL=INFO
- Optionally adjust/disable API log batching:
# Make the poll less frequent
export PREFECT_LOGGING_TO_API_BATCH_INTERVAL=5.0
# Or disable API logging entirely
export PREFECT_LOGGING_TO_API_ENABLED=false
Relevant settings/env vars
- PREFECT_LOGGING_INTERNAL_LEVEL (controls internal machinery like concurrency/services)
- PREFECT_LOGGING_LEVEL (overall Prefect logger level)
- PREFECT_LOGGING_TO_API_ENABLED
- PREFECT_LOGGING_TO_API_BATCH_INTERVAL
- PREFECT_LOGGING_TO_API_BATCH_SIZE
- PREFECT_LOGGING_TO_API_MAX_LOG_SIZE
If you’re also seeing missing logs in Cloud or explicit errors about sending logs, share those details and I can help troubleshoot further.