Prefect seems to be “eating” my logs, as in, any l...
# ask-community
j
Prefect seems to be “eating” my logs, as in, any logs I issue don’t appear when running flows
Copy code
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
I don't work for prefect but I had a similar issue I resolved by using
Copy code
import prefect
logger = prefect.context.logger
Instead of:
Copy code
import logging
logger = logging.getLogger(__name__)
👍 1
j
Am I required to use Prefect’s logger?
j
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