Hello Everyone, Have started looking into prefec...
# prefect-community
d
Hello Everyone, Have started looking into prefect core library recently and exploring it to use for simple use cases. One thing I am struggling with right now is to provide a different timezone to prefect instead of default UTC. By default, prefect is generating UTC timestamps in logs but wanted to change it to my local timezone. Could you please help ?
👀 1
n
Hi @Darshan - Prefect uses Python's built-in logging module; please look at the Python logging documentation for info on how to configure your local Python logger.
d
Thanks @nicholas : what I am confused about is, if I use python logging without prefect, it prints logs using local timezone by default but when used with prefect it prints timestamps in UTC. looks like prefect is overriding default python logging behavior. So was wondering if prefect has any config option to provide which timezone to use while printing logs ?
n
Ah, that's a good flag - it looks like we're explicitly defaulting to UTC instead of local in the logger, which is probably unintentional. Let me see if there's a reason for that and if not we can PR it 🙂
I think this is something we can open a ticket for @Darshan - this line is where the timezone is set in the logger; I'll use @Marvin to open the ticket from this thread 🙂
@Marvin open "Prefect logger doesn't use local Python logger timezone configuration"
d
@nicholas thank you, appreciate your help !
🚀 1