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

Write standard output to /var/log/telegraf with systemd #4184

Closed
wants to merge 1 commit into from

Conversation

danielnelson
Copy link
Contributor

closes #4174

Required for all PRs:

  • Signed CLA.
  • Associated README.md updated.
  • Has appropriate unit tests.

@danielnelson danielnelson added the breaking change Improvement to Telegraf that requires changes to the plugin or agent; for minor/major releases label May 22, 2018
@danielnelson danielnelson added this to the 1.7.0 milestone May 22, 2018
@danielnelson
Copy link
Contributor Author

@phemmer Can you review?

@phemmer
Copy link
Contributor

phemmer commented May 23, 2018

This is essentially a half-reversion of #1860

I personally don't agree with the change as it prevents the logs from going to the systemd journal. This means if people have systemd configured to do log shipping to an external system, the telegraf error logs won't be picked up.
Systemd based systems also do not inherently have log file rotation, meaning this log file will go unchecked and could fill the drive. Some systems utilizing systemd do, but those systems generally have a log daemon (such as rsyslog or syslog-ng) read from the journal and write to the files. As such it is expected to have to clean up the files those daemons generate (and the OS generally comes preconfigured to do so).

@danielnelson
Copy link
Contributor Author

That makes sense, and of course I'd like Telegraf to act as well behaved as possible, while being fairly consistent across init systems. That said, my instinct is that an admin would rather have the log file split out due to how talkative Telegraf can be.

Since journald often is setup to forward to syslog, perhaps we should add rules for syslog handling to rsyslog?

@phemmer
Copy link
Contributor

phemmer commented May 23, 2018

my instinct is that an admin would rather have the log file split out due to how talkative Telegraf can be

journalctl has a -p/--priority option you can use to only see a certain range.

I also don't think telegraf is that noisy. It spits out a little noise sure, but it's not overly verbose (unless misconfigured).

Since journald often is setup to forward to syslog, perhaps we should add rules for syslog handling to rsyslog?

You could, but what about systems which don't have a syslog daemon? Or systems which use syslog-ng vs rsyslog? And then having to configure log rotation to clean these up? You could provide all of the above, using the .d directories (if the locations for these .d directories are standard across distros, and I have no idea if this is the case), so that they only take effect if that daemon is present on the system. This feels a little icky, but I suppose it's not terribly evil.

 

However I should note that my objection is only on principal. I override the telegraf unit file entirely. So whatever is provided by the package doesn't affect me.

@danielnelson
Copy link
Contributor Author

Closing, this is a change we want to make. Further discussion on #4174

@danielnelson danielnelson deleted the systemd-logging branch May 23, 2018 02:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Improvement to Telegraf that requires changes to the plugin or agent; for minor/major releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Log to /var/log/telegraf/telegraf.log on systems using systemd
2 participants