Hi everyone, Is there a simple way to change the t...
# best-practices
s
Hi everyone, Is there a simple way to change the timezone for the logging? I’d like to keep everything as it is—just use my local timezone instead of the default. Could you give me a hint or point me in the right direction? Thank you in advance!
1
r
I haven't done it myself, but have a look through https://docs.meltano.com/guide/logging/
👀 1
e
Will be available in 3.8
🙌 1
s
Many thanks guys! 👍
Hi @Edgar Ramírez (Arch.dev), I wanted to try the local time option, so I created a simple logging.yaml like this:
Copy code
version: 1
disable_existing_loggers: false

formatters:
  my_formatter:
    (): meltano.core.logging.console_log_formatter
    colors: true
    utc: false

handlers:
  console:
    class: logging.StreamHandler
    level: INFO
    formatter: my_formatter

root:
  level: INFO
  propagate: yes
  handlers: [console]
For some reason it does not work for me. I'm running meltano in a docker container, I have checked the version, I have checked the local time inside the container they are both ok. The logging.yaml is also working, because if I switch the colors flag for example, then I see the effect. What am I missing here?
e
Ah, no you're not missing anything. I messed it up. The
utc
formatter works for the formatter in isolation but there are complicated interactions with the rest of the logging infra. Better to control it at the global level. I'll update here, thanks for your patience.
s
Thanks Edgar! 🙏
np 1
e
np! fwiw you can give it a try easily if you have uv installed:
Copy code
NO_UTC=1 uvx --from git+<https://github.com/meltano/meltano.git@edgarrmondragon/feat/utc-env-var> meltano <YOUR ARGS>
s
Just to have a feedback here - I've tried this with 3.9.0 and works as intended. Thanks again Edgar!
e
Awesome!