Hi, when creating a class in a separate library. W...
# prefect-community
s
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.
Copy code
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
Yeah that does. You need to specify extra loggers. Did you do that?
s
This holds for 2.0 as well?
k
Oh my bad no. 2.0 is slightly different one sec
👍 1
Copy code
export PREFECT_LOGGING_EXTRA_LOGGERS=dask,scipy
as seen here
s
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!