Hello Team! I have a problem with extra loggers in...
# ask-community
p
Hello Team! I have a problem with extra loggers in prefect - I have created a simple logger:
logger = logging.getLogger("prefect-logger")
and added an env variable on prefect server
PREFECT_LOGGING_EXTRA_LOGGERS='prefect-logger'
but it doesn't show those logs on the server. Any advice why it doesn't work? Prefect version 3.1.4-3.1.8 (didn't work on either of them)
j
You don't set it globally on the prefect server, it's set per flow. So you want that setting in the client environment (
prefect profile inspect profile-name
). Also, make sure: Does your logger have a log level set, and does it match the logging level that is reported to the GUI?
I also would probably not name your logger "prefect-something" - it's what prefect is using for it's internal loggers.
p
PREFECT_LOGGING_COLORS='True' (from defaults)
PREFECT_LOGGING_EXTRA_LOGGERS='prefect-logger' (from profile)
PREFECT_LOGGING_INTERNAL_LEVEL='ERROR' (from defaults)
PREFECT_LOGGING_LEVEL='INFO' (from defaults)
PREFECT_LOGGING_LOG_PRINTS='False' (from defaults)
PREFECT_LOGGING_MARKUP='False' (from defaults)
`PREFECT_LOGGING_SERVER_LEVEL='WARNING' (from defaults)`these are my profile values, as per documentation:
As for your last reply - it worked like this in prefect 2.x.x version and stopped working when switching to 3.x.x
j
I never used logging on prefect 2.X and can't speak to that part of it. It was just a thought. You settings look OK to me.