-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
A note for the community
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Problem Description
When running Vector, the application's own logs (e.g., startup logs, component status logs) are only output in UTC time (marked with Z suffix), which is 8 hours behind China Standard Time (CST/Asia/Shanghai). This makes it inconvenient to correlate Vector's logs with local system logs or troubleshoot issues based on local time.
The host system has been configured with the correct local timezone, but Vector does not support using the host timezone or customizing the time format for its own logs.
Current Behavior
- Vector's own log output (UTC time)
$ vector -C conf/
2025-12-02T09:15:18.158836Z INFO vector::app: Log level is enabled. level="info"
2025-12-02T09:15:18.220171Z INFO vector::app: API is disabled, enable by setting `api.enabled` to `true` and use commands like `vector top`.
...
- Host system timezone & current time (verified via native commands)
Run the following commands on the host (Rocky Linux 9) to confirm the local timezone and time:
# Check system timezone
$ timedatectl show -p Timezone --value
Asia/Shanghai
# Check current local time (Asia/Shanghai)
$ date +"%F %T"
2025-12-02 17:15:18
As shown above: The host timezone is correctly set to Asia/Shanghai, but Vector's own logs still use UTC time (8 hours behind local time), and there is no way to modify this behavior.
Desired Feature
Add configuration options (preferably in the global config section of Vector's YAML config file) to:
Specify the timezone for Vector's application logs (e.g., log_timezone: "Asia/Shanghai" or log_timezone: "local" to use the host's timezone automatically).
Customize the time format (e.g., log_time_format: "%Y-%m-%d %H:%M:%S.%f %Z" to output time in 2025-12-02 17:15:18.158836 CST format).
Environment Information
Vector version: 0.50.0 (revision: 9053198 2025-09-23)
Host OS: Rocky Linux 9
Host timezone: Asia/Shanghai (verified via timedatectl)
Host local time vs Vector log time: 8 hours difference (Vector uses UTC by default)
Use Cases
When troubleshooting system or application issues, we need to correlate Vector's own operational logs (e.g., startup status, component errors) with other local system logs (e.g., /var/log/messages, application service logs).
Currently, Vector only outputs logs in UTC time, which is 8 hours behind the local time (Asia/Shanghai) of our host. This forces us to manually convert UTC timestamps to local time when cross-referencing logs, which slows down troubleshooting efficiency and increases the risk of timestamp mismatch (e.g., misassociating log events that occurred at different actual times).
The end goal is to align Vector's own log timestamps with the local system time, so we can quickly and accurately link Vector's runtime status with other system events.
Attempted Solutions
To resolve the timezone mismatch issue, we have tried the following methods (all without success):
Checked Vector's official configuration documentation: Reviewed the global configuration, source/sink component configurations, and log-related sections, but found no options to modify the timezone or time format of Vector's own application logs.
Set system environment variables: Launched Vector with the TZ=Asia/Shanghai environment variable (to force the process timezone), but Vector still output logs in UTC time.
Searched existing Vector issues: Briefly searched the Vector GitHub issue tracker for similar timezone requests, but did not find a directly relevant open/closed issue (may have missed it).
Proposal
We propose adding global configuration options in Vector's YAML config file to control the timezone and time format of its own application logs:
Example Configuration:
Add a log section under the global configuration:
# vector.yaml (global config)
log:
# Specify timezone (supports IANA timezone strings or "local" to use the host's timezone)
timezone: "Asia/Shanghai"
# Customize time format (supports strftime-compatible syntax)
time_format: "%Y-%m-%d %H:%M:%S.%f %Z"
Expected Log Output After Configuration:
Instead of the current UTC output:
2025-12-02T09:15:18.158836Z INFO vector::app: Log level is enabled. level="info"
Vector would output logs in the configured local time:
2025-12-02 17:15:18.158836 CST INFO vector::app: Log level is enabled. level="info"
References
None at this time.
Version
vector 0.50.0 (x86_64-unknown-linux-gnu 9053198 2025-09-23 14:18:50.944442940)