flox icon indicating copy to clipboard operation
flox copied to clipboard

Align timestamps between watchdog and process-compose

Open zmitchell opened this issue 6 months ago • 4 comments

The timestamps from process-compose use 24-hour formatted local time in logs, whereas the watchdog uses something else (UTC maybe). For easier debugging it's probably a good idea to align those both to local time since they're running on the same machine.

process-compose:

25-08-11 15:10:01.440 INF Project completed

flox-watchdog:

2025-08-11T21:10:01.442005Z DEBUG watchdog{socket="/Users/zmitchell/.cache/flox/run/flox.3b5c555b.sock" log_dir="/Users/zmitchell/.flox/log"}: flox_watchdog: finished cleanup

zmitchell avatar Aug 11 '25 21:08 zmitchell

It looks like process-compose allows configuring its timestamp format by setting a config value to one of these Go standard library values: https://pkg.go.dev/time#pkg-constants

zmitchell avatar Aug 11 '25 21:08 zmitchell

I see the argument for local time because it's a local tool on the user's machine but I think we should aim to align process-compose with UTC because:

  • 2025-08-11T21:10:01.442005Z is the default used in other places too, such as flox -vv and .flox/log/upgrade-check.*.log
  • it makes it easier to deal with support queries, particularly if they involve FloxHub and Catalog interactions

It looks like process-compose allows configuring its timestamp format by setting a config value to one of these Go standard library values: https://pkg.go.dev/time#pkg-constants

Unfortunately not, it's only used for process logs with disable_json or add_timestamp:

  • https://github.com/F1bonacc1/process-compose/blob/v1.73.0/src/pclog/logger_facade.go#L60-L86

The format is currently hardcoded for the internal logs:

  • https://github.com/F1bonacc1/process-compose/blob/v1.73.0/src/cmd/root.go#L136-L162

It's more than a 5min fix because the project-level config doesn't appear to be available when the initial logger is setup.

dcarley avatar Aug 12 '25 09:08 dcarley

I opened an upstream issue to allow configuring the timestamps of the internal logs: https://github.com/F1bonacc1/process-compose/issues/375

zmitchell avatar Aug 12 '25 22:08 zmitchell

Thanks, I ran out of steam 😄

dcarley avatar Aug 13 '25 08:08 dcarley