Hi Prefect family! i want see DEBUG logs in UI I t...
# prefect-server
j
Hi Prefect family! i want see DEBUG logs in UI I tried
prefect.config.logging.level='DEBUG'
prefect.config.debug=True
and
Copy code
os.environ["PREFECT__LOGGING__LEVEL"]='DEBUG'
However, it doesn't work How can i set DEBUG log level?
c
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
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
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
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
Thank you for the kind words, and I’m glad you’re enjoying using Prefect! We’re always glad to help 😄