Closed mkilchhofer closed 4 months ago
Without configuring any logging options (eg. setting NEBRASKA_LOG_FORMAT to json), every log line starts with <nil>
NEBRASKA_LOG_FORMAT
json
<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
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
.With().Timestamp().xyz
or configure the writer to exclude the timestamp field: https://github.com/flatcar/nebraska/blob/3f95eeb9ded93d96a00586331b3eb213c6ec9fbc/backend/pkg/util/log.go#L26
writer
Either using the default logging settings of the helm chart or starting the backends main.go in VSCode.
No <nil>'s in every log line
---
Description
Without configuring any logging options (eg. setting
NEBRASKA_LOG_FORMAT
tojson
), every log line starts with<nil>
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-L33or configure the
writer
to exclude the timestamp field: https://github.com/flatcar/nebraska/blob/3f95eeb9ded93d96a00586331b3eb213c6ec9fbc/backend/pkg/util/log.go#L26Environment 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 lineAdditional information
---