fix: use SYS: prefix in pino-pretty translateTime to honour TZ env var

pino-pretty's translateTime: "HH:MM:ss" formats all timestamps in UTC,
ignoring the process TZ environment variable. Changing the prefix to
"SYS:HH:MM:ss" instructs pino-pretty to format timestamps in the local
system timezone, so operators running in non-UTC zones see correct
wall-clock times in both the console and the server.log file.

Fixes: #2879
This commit is contained in:
lempkey 2026-04-06 15:06:45 +01:00
parent 6c8569156c
commit 8d20510b9a
2 changed files with 88 additions and 1 deletions

View file

@ -21,7 +21,7 @@ fs.mkdirSync(logDir, { recursive: true });
const logFile = path.join(logDir, "server.log");
const sharedOpts = {
translateTime: "HH:MM:ss",
translateTime: "SYS:HH:MM:ss",
ignore: "pid,hostname",
singleLine: true,
};