-
Notifications
You must be signed in to change notification settings - Fork 13
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
Optionally add EOL (fix #1) #3
Conversation
lib/rfc3164.js
Outdated
@@ -3,6 +3,7 @@ | |||
const moment = require('moment-timezone') | |||
const stringify = require('fast-safe-stringify') | |||
const through2 = require('through2') | |||
const EOL = require('os').EOL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be configurable, e.g. { newline: '\n' }
? Or can we safely assume that \n
will always be an acceptable terminator? I think so since syslog is a Unix tool and \n
is the standard EOL for Unix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's safe to agree on \n
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then let's just have { newline: false }
and { newline: true }
. When true
, just append a '\n'. I'm not sure what would happen if a carriage return or carriage return + line feed were added, as using the OS EOL would do in certain circumstances.
After testing the latest release, I found I was wrong about newline. Logs are sent to the Papertail and they are parsed well (probably somehow I missed it during e2e tests or Papertail fixed it). The only remaining thing is that after sending a syslog through pino-socket they are swallowed. With a new line, they are sent back to stdout. I'm not sure if it's an issue of this library or pino-socket. This works for me, but we can still add this feature because it's increasing readability. What do you think? |
What do you mean "sending a syslog"? |
I'm talking about the following scenario: Anyway, it sounds more like a problem of |
No description provided.