Dave
11/18/2022, 3:19 PMget_run_logger().setLevel(level)
within each task and flow. Would this require overriding flow and task initiation, or similar? Thank you in advance for any help!redsquare
11/18/2022, 3:21 PMDave
11/18/2022, 3:24 PMRyan Peden
11/18/2022, 3:26 PMRyan Peden
11/18/2022, 3:27 PMRyan Peden
11/18/2022, 3:29 PMPREFECT_LOGGING_LEVEL
. Some loggers use that, and some use PREFECT_LOGGING_SERVER_LEVEL
.Dave
11/18/2022, 3:38 PMPREFECT_LOGGING_SERVER_LEVEL
, which might explain the inconsistent behavior, unsure. I'll give that a try. Open to other suggestions as well.
import os
os.environ["PREFECT_LOGGING_LEVEL"] = log_level
os.environ["PREFECT_LOGGING_ROOT_LEVEL"] = log_level
os.environ["PREFECT_LOGGING_HANDLERS_CONSOLE_LEVEL"] = log_level
os.environ["PREFECT_LOGGING_HANDLERS_CONSOLE_FLOW_RUNS_LEVEL"] = log_level
os.environ["PREFECT_LOGGING_HANDLERS_CONSOLE_TASK_RUNS_LEVEL"] = log_level
Ryan Peden
11/18/2022, 3:53 PMos.environ
may or may not work depending on when you run those commands. I think it will work if you run them before you import Prefect. Otherwise, I believe Prefect reads the settings when its module initializes - but I'm going to go double check to code to verify that.Dave
11/18/2022, 4:10 PMPREFECT_LOGGING_SERVER_LEVEL
environment variable forced within Python things seemed to work as expected. Appreciate the help!Ryan Peden
11/18/2022, 4:10 PM