Hi, i am using <loguru> to generate the logs of my...
# ask-community
j
Hi, i am using loguru to generate the logs of my scripts, i can stream this logs files to the logger of prefect?
k
Hey @João Amorim, we rolled out something that would help your last issue with the flow of flows. For this one, I think you need to use their snippet in the README
Copy code
class PropagateHandler(logging.Handler):
    def emit(self, record):
        logging.getLogger(record.name).handle(record)

logger.add(PropagateHandler(), format="{message}")
where logger is the Prefect logger. You would be adding the Handler to the Prefect logger.
Actually sorry I think I was wrong. You want the
InterceptHandler
like this to add them to your logs before they go to the sink. Try adding the logger to the Prefect logger like:
Copy code
from prefect.utilities.logging import get_logger
prefect_logger = get_logger()
prefect_logger.addHandler(InterceptHandler)
j
Thanks i go try this