Arthur
01/16/2025, 4:20 PMMarvin
01/16/2025, 4:20 PMget_run_logger()
function from the prefect.logging
module to retrieve a logger that is aware of the flow or task run context. This allows for detailed and contextual logging.
2. Set Log Level: You can set the log level to debug for more verbose logging. This can be done by configuring the logger in your Python script.
Here is a basic example:
python
from prefect import flow, get_run_logger
@flow
def my_flow():
logger = get_run_logger()
logger.setLevel("DEBUG") # Set the log level to DEBUG
logger.debug("This is a debug log message.")
# Your flow logic here
my_flow()
For more information on logging in Prefect, you can refer to the Prefect Logging Documentation.