GitHub
07/11/2025, 6:54 PMNO_UTC=1 environment variable to emit logs with timestamps in your local timezone
Pull request opened by edgarrmondragon
## Description
This allows the user to configure the logs to use their local timezone for the timestamp. It's global instead of per formatter (as in #9328), which was indeed reverted in #9365.
## How to test this
NO_UTC=1 uvx --from git+https://github.com/meltano/meltano.git@edgarrmondragon/feat/utc-env-var meltano <YOUR ARGS>
## Related Issues
• #9328
• #9365
## Summary by Sourcery
Enable log timestamp timezone configuration via the NO_UTC environment variable and refactor timestamping logic accordingly
New Features:
• Allow logs to emit timestamps in the local timezone when NO_UTC=1
Enhancements:
• Refactor the foreign_pre_chain timestamper into get_default_foreign_pre_chain for dynamic UTC/local behavior
Tests:
• Add tests verifying timestamp behavior for various NO_UTC values (unset, "1", "0", and invalid)
## Summary by Sourcery
Implement a NO_UTC environment variable to let users choose between UTC and local timestamps for log entries and refactor the logging timestamping logic to use a dynamic foreign pre-chain based on this flag.
New Features:
• Allow logs to emit timestamps in the local timezone when NO_UTC=1
Enhancements:
• Replace static TIMESTAMPER and foreign_pre_chain with a get_default_foreign_pre_chain function that reads NO_UTC via get_boolean_env_var
• Update all logging setup and fixtures to use the dynamic pre-chain
Tests:
• Add JSON formatter tests to verify timestamp output for unset, "1", "0", and invalid NO_UTC values under a mocked timezone
meltano/meltanoGitHub
07/11/2025, 6:54 PMNO_UTC=1 environment variable to emit logs with timestamps in your local timezone
Pull request ready for review by edgarrmondragon
meltano/meltanoGitHub
07/15/2025, 6:48 PM