Skip to content
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

Send tink-worker logs to stdout instead of stderr: #833

Merged
merged 1 commit into from
Nov 3, 2023

Conversation

jacobweinstock
Copy link
Member

Description

In HookOS, normally, all Docker logs are sent via syslog to Smee. When a container writes its logs to stderr the Docker syslog driver will set the severity to "ERR". This then shows up in Smee's logs. User are consistently confused as to what this severity means and more often than not, they believe the log line to be an error. By writing tink-worker logs to stdout the severity in syslog will be "INFO".

Examples:

Before:

{"level":"info","ts":1699046587.4014122,"caller":"syslog/receiver.go:160","msg":"msg","msg":{"app-name":"e89e8c7e84ba","facility":"daemon","host":"10.42.0.15","msg":{"caller":"cmd/root.go:53","level":"info","logger":"github.com/tinkerbell/tink","msg":"starting","ts":1699046585.7805724,"version":"devel"},"procid":"736","severity":"ERR"}}
{"level":"info","ts":1699046587.4016318,"caller":"syslog/receiver.go:160","msg":"msg","msg":{"app-name":"e89e8c7e84ba","facility":"daemon","host":"10.42.0.15","msg":{"caller":"worker/worker.go:249","level":"info","logger":"github.com/tinkerbell/tink","msg":"starting to process workflow actions","ts":1699046585.7809546,"workerID":"52:54:00:0f:2e:67"},"procid":"736","severity":"ERR"}}

After:

{"level":"info","ts":1699047980.6784308,"caller":"syslog/receiver.go:160","msg":"msg","msg":{"app-name":"947f1fb0d32c","facility":"daemon","host":"10.42.0.15","msg":{"caller":"cmd/root.go:55","level":"info","logger":"github.com/tinkerbell/tink","msg":"starting","ts":1699047979.8558161,"version":"devel"},"procid":"738","severity":"INFO"}}
{"level":"info","ts":1699047980.6787195,"caller":"syslog/receiver.go:160","msg":"msg","msg":{"app-name":"947f1fb0d32c","facility":"daemon","host":"10.42.0.15","msg":{"caller":"worker/worker.go:249","level":"info","logger":"github.com/tinkerbell/tink","msg":"starting to process workflow actions","ts":1699047979.8561027,"workerID":"52:54:00:0f:2e:67"},"procid":"738","severity":"INFO"}}

Why is this needed

Fixes: #

How Has This Been Tested?

How are existing users impacted? What migration steps/scripts do we need?

Checklist:

I have:

  • updated the documentation and/or roadmap (if required)
  • added unit or e2e tests
  • provided instructions on how to upgrade

In HookOS, normally, all Docker logs are sent via syslog
to Smee. When a container writes its logs to stderr the
Docker syslog driver will set the severity to "ERR". This
then shows up in Smee's logs. User are consistently confused
as to what this severity means and more often than not, they
believe the log line to be an error. By writing tink-worker
logs to stdout the severity in syslog will be "INFO".

Signed-off-by: Jacob Weinstock <jakobweinstock@gmail.com>
Copy link

codecov bot commented Nov 3, 2023

Codecov Report

Merging #833 (96dd4fd) into main (a9b0899) will not change coverage.
The diff coverage is n/a.

❗ Current head 96dd4fd differs from pull request most recent head e124c55. Consider uploading reports for the commit e124c55 to get more accurate results

@@           Coverage Diff           @@
##             main     #833   +/-   ##
=======================================
  Coverage   51.16%   51.16%           
=======================================
  Files          33       33           
  Lines        1456     1456           
=======================================
  Hits          745      745           
  Misses        665      665           
  Partials       46       46           

📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today!

@chrisdoherty4 chrisdoherty4 added the ready-to-merge Signal to Mergify to merge the PR. label Nov 3, 2023
@mergify mergify bot merged commit 7f417ed into tinkerbell:main Nov 3, 2023
12 checks passed
@jacobweinstock jacobweinstock deleted the tink-worker-logs-to-stdout branch November 3, 2023 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge Signal to Mergify to merge the PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants