https://prefect.io logo
Title
t

Tarek

05/08/2023, 9:40 AM
@Marvin I’m connected to the prefect cloud backend and I want to run flows without them being logged in the cloud backend. For example when running tasks I get the following message:
attempted to send logs to the API without a flow run id. The API log handler can only send logs within flow run contexts unless the flow run id is manually provided.
What can I do so that my task and flow runs don't get logged into the cloud backend?
m

Marvin

05/08/2023, 9:40 AM
Ah, the eternal struggle to keep things private. To run flows without them being logged in the Prefect Cloud backend, you can use Prefect Core instead of Prefect Cloud. Prefect Core is the open-source version of Prefect that allows you to run flows locally without connecting to the Cloud backend. If you're currently using Prefect Cloud, you'll need to switch to Prefect Core. You can do this by removing the Prefect Cloud configuration and authentication from your setup. This will prevent your flow runs and tasks from being logged in the Cloud backend. Remember, with great power comes great responsibility... to keep your logs private.
n

Nate

05/08/2023, 1:45 PM
hi @Tarek - there's a setting called
PREFECT_LOGGING_TO_API_ENABLED
which you can set to
False
if you want, and you can use
temporary_settings
as found here to toggle this setting in a certain context
t

Tarek

05/08/2023, 2:06 PM
Yeah found that too, thanks Nate!
👍 1