-
Notifications
You must be signed in to change notification settings - Fork 15
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
Allows custom message and date format. #4
base: master
Are you sure you want to change the base?
Conversation
…MESSAGE_FORMATTER’] and custom date format via os.environment[‘SYSLOG_DATE_FORMATTER’]
def message_format(self): | ||
fmt = os.environ.get( | ||
'SYSLOG_MESSAGE_FORMAT', | ||
self.__class__.DFLT_MSG_FORMAT |
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.
Why not self.DFLT_MSG_FORMAT
(here and below)?
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.
Log routers such as Heka or Logstash are picky about which syslog RFC it is accepting.
So I figured why not let user defines which format they want through os.environ[SYSLOG_MESSAGE_FORMAT]
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 see the reason; I'm just saying you shouldn't use .__class__
here.
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.
Would that work? message_format
is an instance method and DEFAULT_MESSAGE_FORMAT
is class variable.
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.
Yes, it will.
|
@koterpillar Looks like Travis is not pointing at the right Git repo. |
It is correctly merging |
This PR also sets default syslog endpoint values to:
udp:localhost:514
. Ref: #2