Hey, is it possible to have extra_loggers on a dif...
# ask-community
s
Hey, is it possible to have extra_loggers on a diffrent log_level than PREFECT__LOGGING__LEVEL? I´d like to have my custom logger on info level, and CloudTaskRunner and CloudFlowRunner logger on warning
k
Hi @Sebastian! I will double check but I believe there is no way to do this at the moment. You would need to grab that logger in your code and set the level that way.
s
Hi Kevin, in the meantime i got a pretty hacky workaround:
Copy code
def log_info(msg:)
  prefect.context.config.logging.level = 'INFO'
  <http://logger.info|logger.info>(msg)    
  prefect.context.config.logging.level = 'WARNING'
It does work, but it feels strange to change the global logging level at every logging message. I hope i just missed something
k
No I think this is right (although I was expecting you to do this for the other loggers but either way works). There is no Prefect built-in feature to adjust the levels of these loggers separately.
s
Alright, thank you 🙂
k
Yeah sorry about that