Skip to content

style: Improve logging similarity to InfluxDB #737

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
style: Improve logging similarity to InfluxDB
  • Loading branch information
mtsfer committed Apr 10, 2024
commit 04f0dfa265a03642ca8f7076f0a507ebc86d2e91
6 changes: 3 additions & 3 deletions influxdb/2.7/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ function log () {
return
fi

local attrs='"system": "docker"'
local attrs="system=docker"
while [ "$#" -gt 1 ]; do
attrs="${attrs}, \"$1\": \"$2\""
attrs="${attrs} $1: $2"
shift 2
done

local -r logtime="$(date --utc +'%FT%T.%NZ')"
1>&2 echo -e "${logtime}\t${level}\t${msg}\t{${attrs}}"
1>&2 echo -e "ts=${logtime} lvl=${level} msg=\"${msg}\" ${attrs}"
}

# Set the global log-level for the entry-point to match the config passed to influxd.
Expand Down