Ji-Oh Yoo
01/31/2025, 12:24 AMMarvin
01/31/2025, 12:24 AMJi-Oh Yoo
01/31/2025, 12:32 AMlogger = logging.getLogger("hi")
In [11]: @flow
...: def my_flow():
...: my_task()
...:
In [12]:
In [12]: @task
...: def my_task():
...: logger.warning("inside the flow")
When I run this, I see the logs
00:29:51.630 | INFO | prefect.engine - Created flow run 'mini-falcon' for flow 'my-flow'
00:29:54.381 | INFO | Flow run 'mini-falcon' - Created task run 'my_task-0' for task 'my_task'
00:29:54.383 | INFO | Flow run 'mini-falcon' - Executing 'my_task-0' immediately...
00:29:55.194 | WARNING | hi - inside the flow
00:29:56.166 | INFO | Task run 'my_task-0' - Finished in state Completed()
00:29:56.410 | INFO | Flow run 'mini-falcon' - Finished in state Completed('All states completed.')
and it seems the logger's configuration is modified somehow, within the flow or the taskMarvin
01/31/2025, 12:32 AMPREFECT_LOGGING_ROOT_LEVEL
to change logging levels.
- Providing your own logging.yml
configuration file in your PREFECT_HOME
directory to completely overhaul Prefect's logging.
For more details, refer to the Prefect logging documentation.Ji-Oh Yoo
01/31/2025, 12:34 AMMarvin
01/31/2025, 12:34 AMWARNING
level logs to the console. You can modify this by setting the PREFECT_LOGGING_ROOT_LEVEL
environment variable.
2. Custom Logging Configuration: Create your own logging.yml
file in your PREFECT_HOME
directory. This allows you to completely overhaul Prefect's logging configuration.
For more detailed instructions, you can refer to the Prefect logging documentation.Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.
Powered by