How can I globally disable sending logs to the backend API?

Prefect 2.0

Set the following environment variable:


Prefect 1.0

Set the following environment variable:


An agent will respect the config on the machine it is started on when determining if logs should be sent to the Cloud backend. This allows you to disable sending logs to Prefect Cloud per machine, e.g. using the config.toml file:


# Send flow run logs to Prefect Cloud/Server
send_flow_run_logs = false

Logging can also be disabled for flow runs by providing the --no-cloud-logs flag when starting a Prefect agent from the CLI. This will ignore the value set in the config.toml, e.g.:

prefect agent local start --label --no-cloud-logs