<@ULVA73B9P> how do I increase the max size of the...
# ask-marvin
e
@Marvin how do I increase the max size of the logs allowed to the API ?
m
thought for 475.8 seconds
Short answer: raise the client-side limits that Prefect uses before sending logs. In Prefect 3.x, logging-to-API is controlled by these settings: -
PREFECT_LOGGING_TO_API_MAX_LOG_SIZE
(bytes per log record, default 1,000,000) -
PREFECT_LOGGING_TO_API_BATCH_SIZE
(bytes per request, default 4,000,000; must be >= max_log_size) Set them via env vars or your Prefect profile, then restart your flow/worker so they take effect. Examples: - With env vars
Copy code
export PREFECT_LOGGING_TO_API_MAX_LOG_SIZE=2000000
export PREFECT_LOGGING_TO_API_BATCH_SIZE=6000000
- With the CLI (updates your current profile)
Copy code
prefect config set PREFECT_LOGGING_TO_API_MAX_LOG_SIZE=2000000 PREFECT_LOGGING_TO_API_BATCH_SIZE=6000000
Notes: - If you’re on Prefect Cloud, there’s also a server-side request limit; if you crank these too high you may hit a 413 response. In that case, you’ll need to keep messages smaller or split them. - If you’re self-hosting Prefect Server and still bump into a 413, tell me how you’re deploying it and I’ll help you locate the server request-size setting.