https://prefect.io logo
Title
s

Sander

05/19/2022, 2:15 PM
Hi, when creating a class in a separate library. What is best practice so that the prefect logger picks up the log lines? Currently I'm on this path but I'm struggling to see them in the gui.
from logging import getLogger

logger = getLogger(__name__)

Class MyClass:
    def __init__(self):
         pass

    def my_method(self):
         <http://logger.info|logger.info>(‘hi’)
Does that make sense?
k

Kevin Kho

05/19/2022, 2:17 PM
Yeah that does. You need to specify extra loggers. Did you do that?
s

Sander

05/19/2022, 2:19 PM
This holds for 2.0 as well?
k

Kevin Kho

05/19/2022, 2:20 PM
Oh my bad no. 2.0 is slightly different one sec
👍 1
export PREFECT_LOGGING_EXTRA_LOGGERS=dask,scipy
as seen here
s

Sander

05/19/2022, 2:30 PM
Usually we include all downstream modules without additional config, but I'll check it out. Thanks!
Look like I need PREFECT_LOGGING_ROOT_LEVEL but will check
Setting extra loggers worked indeed perfect for me. Thanks!