I'm using the prefect `get_run_logger()` to log du...
# ask-community
c
I'm using the prefect
get_run_logger()
to log during my flow and task runs. However I run into the issue when developing locally that the logger throws an error if it is run without a flow or task run context. Its particularly annoying when I use pycharm's debugger because if I use the debugger on a "dummy" flow then the cloud UI tends to get messy with one-off flows. Has anyone faced this issue and figured out a fix?
t
I avoid that logger handler outright. If you are building a module that is using a logger object, you can use the environment variable:
Copy code
export PREFECT_LOGGING_EXTRA_LOGGERS="flint"
to attach the prefect api handler that way.
m
@Tim Galvin, do you have any suggestions on what should i do if im using loguru for logging inside the flow code. I tried export PREFECT_LOGGING_EXTRA_LOGGERS="loguru" but didnt work
t
I don't sorry. Is logguru a wrapper around the stdlb logging? If so, you don't want to attach the logguru as at the extra module -- you want to add whatever your actual module that is using logguru is called