Skip to content
This repository was archived by the owner on Sep 21, 2020. It is now read-only.

GPII-3394: Use logfile for logging#1

Merged
mrtyler merged 2 commits into
gpii-ops:masterfrom
mrtyler:gpii-3394-logfile
Dec 5, 2018
Merged

GPII-3394: Use logfile for logging#1
mrtyler merged 2 commits into
gpii-ops:masterfrom
mrtyler:gpii-3394-logfile

Conversation

@mrtyler

@mrtyler mrtyler commented Dec 4, 2018

Copy link
Copy Markdown

syslog is not generally available inside a container.

This also makes a whitespace-only, documentation-only change that causes the example DaemonSet to break :).

This PR is essentially a bugfix for upstream. I will PR it there after review here.

syslog is not generally available inside a container.
# Enable logging with logfile as syslog is not generally available inside a container.
<Plugin "logfile">
LogLevel "info"
File "/var/log/collectd.log"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this log into stdout/stderr instead? Looks like it is possible using the same logfile plugin.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for stdout (but I don't have a good understanding of context here)

@natarajaya

Copy link
Copy Markdown

LGTM

@stepanstipl stepanstipl left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

# Enable logging with logfile as syslog is not generally available inside a container.
<Plugin "logfile">
LogLevel "info"
File "/var/log/collectd.log"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for stdout (but I don't have a good understanding of context here)

@mrtyler

mrtyler commented Dec 5, 2018

Copy link
Copy Markdown
Author

Using stdout is a good idea. However, I tried it and it didn't work -- no logs in kubectl logs or in Stackdriver. I think this is because run-agent.sh is the container's entrypoint, not the collectd daemon.

The good news is run-agent.sh tails /var/log/collectd.log, so as-is we do see logs in kubectl logs and in Stackdriver.

@mrtyler

mrtyler commented Dec 11, 2018

Copy link
Copy Markdown
Author

Proposed to upstream as wikiwi#3

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants