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

Add ability for Vector to log to syslog directly #19657

Open
positron96 opened this issue Jan 18, 2024 · 3 comments
Open

Add ability for Vector to log to syslog directly #19657

positron96 opened this issue Jan 18, 2024 · 3 comments
Labels
domain: observability Anything related to monitoring/observing Vector type: feature A value-adding code addition that introduce new functionality.

Comments

@positron96
Copy link

positron96 commented Jan 18, 2024

A note for the community

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Use Cases

When vector is installed as a systemd service (on Ubuntu and Debian at least), its logs are fed into journald, and when you view the logs via journalctl -u vector, they are all at INFO severity, hence no colorization. Even if vector reports errors/warnings (and ERROR/WARNING word is in the log text), the syslog severity is still INFO. In fact, I use vector to take system logs and send them to Loki+Grafana, and all vector logs are shown as INFO there as well (because I process syslog severity into grafana loglevel).

Attempted Solutions

I tried to find in the documentation on configuring vector a way to specify what logging method to use, didn't find anything.

Proposal

It would be nice to have proper syslog severity assigned to log events, to enable journalctl filtering, coloring and related features.

There could be a configuration option to send logs to stdout and color them internally (current behavior seems to do this and enables/disables coloring depending on terminal interactivity or something like that) or to send them to syslog with proper severity and facility. Systemd unit will then set this configuration (as a commandline switch or ENV var) to syslog, while default will be stdout.

References

No response

Version

tried on 0.30.0, 0.35.0, same behavior

@positron96 positron96 added the type: feature A value-adding code addition that introduce new functionality. label Jan 18, 2024
@positron96 positron96 changed the title Support syslog loglevels of vector's own logs Support syslog severity of vector's own logs Jan 18, 2024
@jszwedko
Copy link
Member

Thanks for opening this @positron96 . I think I need to better understand the desired implementation here. Currently Vector simply outputs logs to stderr. It's up to the parent process to decide what to do with that output (e.g. for SystemD it is routed to JournalD by default). Is the request here to be able to have Vector log its output via JournalD or Syslog directly?

@positron96
Copy link
Author

Hi @jszwedko. Yes, you got everything right. And to not break current behavior, the proposal is to make it configurable via command line switch or env variable, and keep current behavior as default.

@jszwedko
Copy link
Member

Gotcha, I see. Let me retitle this issue to be to add the ability for Vector to log via syslog.

I think the way we'd be likely to enable this is to encourage users to use the internal_logs source to capture Vector's logs and route them to a socket sink. The missing link is that there is no syslog codec that can be used just yet. That's being worked on over here: #17668

@jszwedko jszwedko changed the title Support syslog severity of vector's own logs Add ability for Vector to log to syslog directoly Jan 22, 2024
@jszwedko jszwedko changed the title Add ability for Vector to log to syslog directoly Add ability for Vector to log to syslog directly Jan 22, 2024
@jszwedko jszwedko added the domain: observability Anything related to monitoring/observing Vector label Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain: observability Anything related to monitoring/observing Vector type: feature A value-adding code addition that introduce new functionality.
Projects
None yet
Development

No branches or pull requests

2 participants