Problem
Hypercart_Logger writes both the log filename date and the entry timestamp in UTC, with a hardcoded UTC label. For a team almost entirely in one timezone, this makes logs awkward to read and causes a confusing mismatch (the filesystem mtime is local while the filename/content date is UTC — e.g. a file modified at 5pm Pacific is named hypercart-2026-05-30.log).
Where (includes/class-hypercart-logger.php)
- Entry timestamp —
Hypercart_Time::utc_format( 'Y-m-d H:i:s' ) (line ~173) plus a hardcoded UTC label in the format string (line ~188): '[%s UTC] %s %s: %s'
- Filename date —
Hypercart_Time::utc_format( 'Y-m-d', $timestamp ) in get_log_file() (line ~362)
- Cleanup cutoff — also uses
utc_format() (line ~618), so date-based retention should move with the same change
Desired
Filenames and entry timestamps in Pacific time/date (auto-handling PST/PDT), and the UTC label updated to reflect the actual zone (e.g. PDT/PST via the T format, or the offset).
Example: [2026-05-29 17:00:49 PDT] query_guard WARNING: ... in a file named hypercart-2026-05-29.log.
Implementation options (pick one)
- Force Pacific, filterable (recommended) — default
new DateTimeZone('America/Los_Angeles'), exposed via a hypercart_log_timezone filter. Consistent on every site regardless of WP settings; overridable per-site.
- Follow WP site timezone — switch the logger from
utc_format() to the existing site-timezone Hypercart_Time::format() (wp_date() / wp_timezone()). Most WP-idiomatic, but only yields Pacific where Settings → General is set to Los Angeles.
- Hardcode Pacific, no filter — simplest; always Pacific, no escape hatch.
Hypercart_Time already distinguishes utc_format() (forced UTC) from format() (site timezone), so the plumbing exists.
Notes / impact
- This is a shared logging library — the change affects every Hypercart plugin that logs (Server Monitor, Performance Monitor, QueryGuard fallback, etc.).
- Daily file rotation boundary moves from UTC midnight to Pacific midnight. Existing UTC-named files will coexist harmlessly.
- Keep storage/DB timestamps (
now(), mysql_utc(), iso8601()) in UTC — this change is for the human-facing log files only.
Surfaced while validating the QueryGuard logging bridge (queryguard-plugin #7).
Problem
Hypercart_Loggerwrites both the log filename date and the entry timestamp in UTC, with a hardcodedUTClabel. For a team almost entirely in one timezone, this makes logs awkward to read and causes a confusing mismatch (the filesystem mtime is local while the filename/content date is UTC — e.g. a file modified at 5pm Pacific is namedhypercart-2026-05-30.log).Where (includes/class-hypercart-logger.php)
Hypercart_Time::utc_format( 'Y-m-d H:i:s' )(line ~173) plus a hardcodedUTClabel in the format string (line ~188):'[%s UTC] %s %s: %s'Hypercart_Time::utc_format( 'Y-m-d', $timestamp )inget_log_file()(line ~362)utc_format()(line ~618), so date-based retention should move with the same changeDesired
Filenames and entry timestamps in Pacific time/date (auto-handling PST/PDT), and the
UTClabel updated to reflect the actual zone (e.g.PDT/PSTvia theTformat, or the offset).Example:
[2026-05-29 17:00:49 PDT] query_guard WARNING: ...in a file namedhypercart-2026-05-29.log.Implementation options (pick one)
new DateTimeZone('America/Los_Angeles'), exposed via ahypercart_log_timezonefilter. Consistent on every site regardless of WP settings; overridable per-site.utc_format()to the existing site-timezoneHypercart_Time::format()(wp_date()/wp_timezone()). Most WP-idiomatic, but only yields Pacific where Settings → General is set to Los Angeles.Hypercart_Timealready distinguishesutc_format()(forced UTC) fromformat()(site timezone), so the plumbing exists.Notes / impact
now(),mysql_utc(),iso8601()) in UTC — this change is for the human-facing log files only.Surfaced while validating the QueryGuard logging bridge (queryguard-plugin #7).