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

Make PRI and version fields optional #15

Closed
JonZeolla opened this issue Sep 2, 2018 · 3 comments
Closed

Make PRI and version fields optional #15

JonZeolla opened this issue Sep 2, 2018 · 3 comments

Comments

@JonZeolla
Copy link

JonZeolla commented Sep 2, 2018

This lib assumes that the PRI and version will be included in a log. While this is in the spec/RFC and sent on the network, it is standard practice to not write this to disk, but instead it is used by syslog software to choose which file to write it to, and strip it before writing to disk so the first component of the log is the date/timestamp. Situations where syslog is pulled from disk and parsed with this library will all fail with a syntax error. I would suggest making the PRI field optional =)

Some evidence of my claims:

  • rsyslog documentation explaining that PRI fields are sent but not recorded here.
  • The rsyslog built-in templates for writing to disk exclude PRI (details). Note that they are retained in some cases, but in situations such as forwarding to another syslog server or in the still-draft ietf-syslog-protocol-23 format.
  • Even legacy file formats only include PRI when forwarding (details).
  • Back in 2010 the SUSE syslog-ng format defaults to writing without PRI.
@ottobackwards
Copy link
Contributor

@JonZeolla that actually means the priority AND the version are missing?

@JonZeolla
Copy link
Author

Yup, exactly. Edited the issue title

@JonZeolla JonZeolla changed the title Make PRI optional Make PRI and version fields optional Sep 3, 2018
@ottobackwards
Copy link
Contributor

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants