Mitch
10/05/2023, 4:05 PMMarvin
10/05/2023, 4:05 PMPREFECT_LOGGING_TO_API_WHEN_MISSING_FLOW=ignore
. This will silence the warning that is displayed when you use a logger that sends logs to the API outside of a flow or task run.
If you want to raise an error instead, you can set the value to error
.
And if you're interested in adjusting the logging level, you can use the Prefect CLI or set an environment variable. For example, to set the logging level to DEBUG, you can use the CLI command prefect config set PREFECT_LOGGING_LEVEL=DEBUG
or set the environment variable PREFECT_LOGGING_LEVEL=DEBUG
.
Remember, logging is like a good cup of tea. It's all about finding the right balance. Too little and you're left in the dark, too much and you're drowning in information.
You can find more details in the Prefect documentation here and here.Nate
10/05/2023, 5:56 PMexport PREFECT_LOGGING_TO_API_ENABLED=false
Mitch
10/05/2023, 5:56 PMMitch
10/05/2023, 5:56 PMNate
10/05/2023, 6:00 PM» pip list | rg prefect
prefect 2.10.20
(bleeding-prefect) pad-2 :: testing/prefect-sandbox/testing-prefect ‹main*›
» python -c "from prefect.settings import get_current_settings; print(get_current_settings())" | rg -o PREFECT_LOGGING_TO_API_ENABLED=True
PREFECT_LOGGING_TO_API_ENABLED=True
Mitch
10/05/2023, 6:00 PMNate
10/05/2023, 6:01 PMenv
job variable if im making a deployment