Skip to content

fix(logging): log timestamps use local time instead of UTC#28434

Merged
vincentkoc merged 4 commits intoopenclaw:mainfrom
liuy:fix/logging-timestamp-local-time
Mar 2, 2026
Merged

fix(logging): log timestamps use local time instead of UTC#28434
vincentkoc merged 4 commits intoopenclaw:mainfrom
liuy:fix/logging-timestamp-local-time

Conversation

@liuy
Copy link
Contributor

@liuy liuy commented Feb 27, 2026

Problem

Log timestamps used UTC, but documentation says:

"The date uses the gateway host's local timezone."

Solution

Replace toISOString() with formatLocalIsoWithOffset() in file logger.

Before: 2026-02-27T06:50:21.000Z (UTC)
After: 2026-02-27T14:50:21.000+08:00 (local time)

liuy added 2 commits February 27, 2026 14:48
Problem: Log timestamps used UTC, but docs say they should use host local timezone
Verify logger uses local time (not UTC) in file logs
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 27, 2026

Greptile Summary

Replaced UTC timestamps with local time format in file logger to match documentation stating "the date uses the gateway host's local timezone."

  • Changed file logger timestamps from toISOString() (UTC) to formatLocalIsoWithOffset() (local time with offset)
  • Format changed from 2026-02-27T06:50:21.000Z to 2026-02-27T14:50:21.000+08:00
  • Applied to both regular log entries and size cap warning messages in src/logging/logger.ts
  • Added integration test verifying timestamp format in actual log files
  • Console logging intentionally unchanged (still uses UTC), which is appropriate for distributed systems

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The change is well-isolated to the file logger, uses an existing tested helper function (formatLocalIsoWithOffset), includes comprehensive test coverage, and aligns with documented behavior. The implementation correctly handles timezone offsets and maintains backward compatibility in log structure (only the timestamp format changes).
  • No files require special attention

Last reviewed commit: 06239e7

@vincentkoc vincentkoc merged commit ade46d8 into openclaw:main Mar 2, 2026
15 of 16 checks passed
Linux2010 pushed a commit to Linux2010/openclaw that referenced this pull request Mar 2, 2026
…28434)

* fix(logging): log timestamps use local time instead of UTC

Problem: Log timestamps used UTC, but docs say they should use host local timezone

* test(logging): add test for logger timestamp format

Verify logger uses local time (not UTC) in file logs

* changelog: note logger timestamp local-time fix

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
mrosmarin added a commit to mrosmarin/openclaw that referenced this pull request Mar 2, 2026
* main: (174 commits)
  refactor(gateway): unify control-ui and plugin webhook routing
  fix(exec): resolve PATH key case-insensitively for Windows pathPrepend (openclaw#25399) (openclaw#31879)
  fix(tsgo): unblock baseline type errors (openclaw#31873)
  fix(security): harden sms.send dangerous-node defaults
  fix(gateway): let POST requests pass through root-mounted Control UI to plugin handlers
  fix(browser): fail closed navigation guard with env proxy
  test(perf): reduce timer teardown overhead in cron issue regressions
  refactor: split browser context/actions and unify CDP timeout policy
  test(perf): cache redact hints and tune guardrail scan concurrency
  docs(changelog): credit sessions_spawn agentId validation fix (openclaw#31381)
  fix(agents): validate sessions_spawn agentId format (openclaw#31381)
  fix(agents): add strict format validation to sessions_spawn for agentId
  fix(logging): log timestamps use local time instead of UTC (openclaw#28434)
  test(perf): remove redundant module reset in system presence version tests
  test(perf): avoid module reload churn in config guard tests
  fix(gateway): fail closed plugin auth path canonicalization
  docs(changelog): credit sandbox mkdirp boundary fix (openclaw#31547)
  fix(sandbox): allow mkdirp boundary checks on existing directories (openclaw#31547)
  fix(sandbox): allow mkdirp boundary check on existing directories
  fix: preserve dns pinning for strict web SSRF fetches
  ...
execute008 pushed a commit to execute008/openclaw that referenced this pull request Mar 2, 2026
…28434)

* fix(logging): log timestamps use local time instead of UTC

Problem: Log timestamps used UTC, but docs say they should use host local timezone

* test(logging): add test for logger timestamp format

Verify logger uses local time (not UTC) in file logs

* changelog: note logger timestamp local-time fix

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
dawi369 pushed a commit to dawi369/davis that referenced this pull request Mar 3, 2026
…28434)

* fix(logging): log timestamps use local time instead of UTC

Problem: Log timestamps used UTC, but docs say they should use host local timezone

* test(logging): add test for logger timestamp format

Verify logger uses local time (not UTC) in file logs

* changelog: note logger timestamp local-time fix

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
OWALabuy pushed a commit to kcinzgg/openclaw that referenced this pull request Mar 4, 2026
…28434)

* fix(logging): log timestamps use local time instead of UTC

Problem: Log timestamps used UTC, but docs say they should use host local timezone

* test(logging): add test for logger timestamp format

Verify logger uses local time (not UTC) in file logs

* changelog: note logger timestamp local-time fix

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
…28434)

* fix(logging): log timestamps use local time instead of UTC

Problem: Log timestamps used UTC, but docs say they should use host local timezone

* test(logging): add test for logger timestamp format

Verify logger uses local time (not UTC) in file logs

* changelog: note logger timestamp local-time fix

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants