https://prefect.io logo
Title
j

José Duarte

08/29/2022, 1:47 PM
Prefect seems to be “eating” my logs, as in, any logs I issue don’t appear when running flows
import prefect
import logging
logger = logging.getLogger(__name__)

@prefect.flow
def f():
    <http://logger.info|logger.info>("test") # doesn't appear
What am I doing wrong?
1
s

Scott White

08/29/2022, 1:51 PM
I don't work for prefect but I had a similar issue I resolved by using
import prefect
logger = prefect.context.logger
Instead of:
import logging
logger = logging.getLogger(__name__)
👍 1
j

José Duarte

08/29/2022, 1:52 PM
Am I required to use Prefect’s logger?
j

Joao Moniz

08/29/2022, 2:14 PM
Short answer, no. Take a look at the docs for more info on basics of logging, and here for instructions on setting up extra loggers
🙌 1