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

Prefect 2.0

Set the following environment variable:

export PREFECT_LOGGING_ORION_ENABLED=False

Prefect 1.0

Set the following environment variable:

export PREFECT__CLOUD__SEND_FLOW_RUN_LOGS=false

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:

[cloud]

# 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