https://prefect.io logo
t

Tim Galvin

07/12/2023, 1:46 PM
Hi all. I feel like I am taking crazy pills. Lets say I am writing a package named
tool
. All my functions make use of a logger constructed in
tools.logging
. All other functions in all other pythons use
from tool.logging import logger
, which seems to work great. Now I would like to keep my flows and tasks distinctly separate from my actual business logic in
tool
. So, in my
tool.flows
python file I have something like
Copy code
from tool.calibrate import calibrate
from tool.image import image
from prefect import task, flow

task_calibrate = task(calibrate)
task_image = task(image)

@flow
def calibrate_image():
    img = '/test/data'
    cal = task_calibrate.sumbit(img)
    out = task_image(cal)
Each of my functions (
calibrate
, and
image
) have a lot of
<http://logger.info|logger.info>
in them that I want to keep. So I was hoping I could use the
PREFECT_LOGGING_EXTRA_LOGGERS='tool'
and all would be good. But now. I can see my
tool
logs in prefect formatted logs written to disk, but I can not see them written to the server. Would anyone have any ideas, or other best practises where it comes to the logger and the server API logging handler?
And ultimately it was a silly Tim mistake setting the logger level to WARN.