Log time Issue
When I testing commands through cli:
There is approximately 61 minutes between log time and my local time(CET)
Example:
2024/01/31 15:07:18 [AUDIT] cZPgybnC SecretListRequest {{method:[[GET]],url:...
Local time is ~2024/01/31 16:08:18
func AuditLn(correlationId *string, v ...any) { // Audit is always logged. var args []any args = append(args, "[AUDIT]") args = append(args, *correlationId) args = append(args, v...) log.Println(args...) }
func Println(v ...any) { if std.isDiscard.Load() { return } std.Output(2, fmt.Sprintln(v...)) }
func (l *Logger) Output(calldepth int, s string) error { now := time.Now() ... l.formatHeader(&l.buf, now, file, line)
... if l.flag&(Ldate|Ltime|Lmicroseconds) != 0 { if l.flag&LUTC != 0 { t = t.UTC() } ...
Is this a matter that needs to be considered?
Not sure. I’ll check and verify if it’s the same in the build server too.
If it’s specific to user’s environment we may ignore it.
But if you can find the root cause @sahinakyol , feel free to create a PR that fixes this.
I don't think there is much we can do here.
log.AuditLn uses the stdlib log package. And the time comes from log module itself.
So, at least it will be consistent across the VSecM instance; and assuming we are using a time server of some sort in a production environment, it will be consistent across the cluster(s) too.
I think go's default log time is UTC; so it is expected to have 1hr delta between CET.
That also means, this is a behavior by design, in a sense :) . The output will always be UTC, and it will be consistent.
Closing this for now.
We might want to revisit it if/when we consider using structured logging (slog).