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
nicholas
10/20/2020, 11:04 PM
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
Darshan
10/20/2020, 11:17 PM
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
nicholas
10/20/2020, 11:29 PM
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 🙂
nicholas
10/20/2020, 11:37 PM
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 🙂
nicholas
10/20/2020, 11:38 PM
@Marvin open "Prefect logger doesn't use local Python logger timezone configuration"
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.