https://prefect.io logo
Title
j

jaehoon

05/12/2021, 2:00 AM
Hi Prefect family! i want see DEBUG logs in UI I tried
prefect.config.logging.level='DEBUG'
prefect.config.debug=True
and
os.environ["PREFECT__LOGGING__LEVEL"]='DEBUG'
However, it doesn't work How can i set DEBUG log level?
c

Chris White

05/12/2021, 2:06 AM
Hi @jaehoon - logging levels must be set prior to importing the prefect package. There are many ways of doing this depending on your goals: • you can set the logging level for ad-hoc runs on the Run page in the Advanced Configuration settings • you can specify
env={"PREFECT__LOGGING__LEVEL": "DEBUG"}
on any RunConfig • you can set DEBUG level logs on your agent by starting your agent in an environment where
PREFECT__LOGGING__LEVEL=DEBUG
is set as an environment variable • you can start your agent with the
-e
PREFECT__LOGGING__LEVEL=DEBUG
flag Note that setting
os.environ
doesn’t do anything and isn’t good practice (Python can’t reset its own OS environment)
💯 1
👍 1
🙏 1
j

jaehoon

05/12/2021, 2:16 AM
Oh, it works immediately, Thank you! I set agent option -f --log-level DEBUG Debug logs work in agent terminal, but I doesn't appear in Prefect Cloud UI what's the reason?
👍 1
c

Chris White

05/12/2021, 2:18 AM
Agent logs are not stored in the backend at this time, but any run that agent submits should have debug level logs that are visible in the UI
😍 1
j

jaehoon

05/12/2021, 3:09 AM
I deeply appreciate your kindness I'm working at a Korean startup we find out prefect is a perfect fit for our situation Thank you for your supprot
:marvin: 1
c

Chris White

05/12/2021, 3:10 AM
Thank you for the kind words, and I’m glad you’re enjoying using Prefect! We’re always glad to help 😄