Pascal Jahan Elahi (Pawsey)
02/10/2025, 8:44 AMMarvin
02/10/2025, 8:45 AMget_run_logger()
method and manage print statements using the log_prints
option. Here's a brief overview:
1. Logging in Prefect: You can log from a flow or a task by retrieving a logger instance with get_run_logger()
. The standard Python logging methods can then be used. Prefect Logging Documentation
2. Print Statement Logging: Prefect allows automatic logging of print statements by setting log_prints=True
on tasks or flows. This redirects the built-in print
to the Prefect logger at the INFO level.
For visual outputs like matplotlib plots, you might need to save the plots as image files and store them in a location accessible to your team or link them in the logs.
If you'd like to explore further customization of logging or explore additional Prefect features, you can refer to the Prefect documentation or its GitHub repository for more examples and guidance.