flatcar / nebraska

Update monitor & manager for applications using the Omaha protocol, optimized for Flatcar Container Linux.
https://kinvolk.io/docs/nebraska/latest
Apache License 2.0
168 stars 42 forks source link

Every log line starts with <nil> (with default logger config) #715

Closed mkilchhofer closed 4 months ago

mkilchhofer commented 6 months ago

Description

Without configuring any logging options (eg. setting NEBRASKA_LOG_FORMAT to json), every log line starts with <nil>

<nil> DBG Unknown format context=api logFormat=
<nil> DBG Unknown format context=nebraska logFormat=
<nil> DBG Unknown format context=auth logFormat=
<nil> DBG Unknown format context=omaha logFormat=
<nil> DBG Unknown format context=nebraska logFormat=
<nil> DBG Unknown format context=nebraska logFormat=
<nil> DBG Unknown format context=syncer logFormat=

   ____    __
  / __/___/ /  ___
 / _// __/ _ \/ _ \
/___/\__/_//_/\___/ v4.10.2
High performance, minimalist Go web framework
https://echo.labstack.com
____________________________________O/_______
                                    O\
⇨ http server started on [::]:8000
<nil> INF processEvent eventError 0 appID=(REDACTED) context=omaha event="update complete.success reboot" group=(REDACTED) machineId=(REDACTED) previousVersion=
<nil> ERR getInstances - getting instances params {(REDACTED) (REDACTED) 0  0 0    } error="invalid duration param null" context=nebraska

Impact

Either we should hide the timestamp field or we should instantiate zerolog with .With().Timestamp().xyz: https://github.com/flatcar/nebraska/blob/3f95eeb9ded93d96a00586331b3eb213c6ec9fbc/backend/pkg/util/log.go#L30-L33

or configure the writer to exclude the timestamp field: https://github.com/flatcar/nebraska/blob/3f95eeb9ded93d96a00586331b3eb213c6ec9fbc/backend/pkg/util/log.go#L26

Environment and steps to reproduce

Either using the default logging settings of the helm chart or starting the backends main.go in VSCode.

Expected behavior

No <nil>'s in every log line

Additional information

---