Author vinay.sajip
Recipients Carl.Crowder, r.david.murray, vinay.sajip
Date 2011-05-24.17:06:34
SpamBayes Score 9.88098e-14
Marked as misclassified No
Message-id <1306256795.63.0.0227189932814.issue12168@psf.upfronthosting.co.za>
In-reply-to
Content
Even though expecting the NUL-terminator is legacy behaviour, newer versions of the syslog daemons presumably follow Postel's rule of "be conservative in what you do, be liberal in what you accept from others". Can flume not be changed to follow this principle, given that ordinarily you wouldn't expect a NUL terminator byte on syslog messages?

When the implementation of SysLogHandler was changed to comply (more closely) with RFC5424, the log_format_string value was inadvertently left behind in Python 2.x, and it makes sense to remove it since changing it doesn't do anything useful.

Having an append_nul parameter to control NUL-termination is certainly doable, and this approach will keep the 2.x and 3.x implementations more or less the same (as 3.x doesn't have a log_format_string attribute). I suggest "nul" rather than "null" since we're talking about appending a NUL byte to the message.

However, having it as an additional keyword parameter to the constructor could cause dictConfig failures if configurations specifying it are used with an old version of Python (e.g. 3.2.0) which doesn't have the parameter. For this reason, it might be better to have an append_nul class attribute (defaulting to True) which can be overridden with an instance attribute set to False. (This approach can still be used with dictConfig, as you can use a factory function other than the SysLogHandler class to construct a SysLogHandler instance.)
History
Date User Action Args
2011-05-24 17:06:35vinay.sajipsetrecipients: + vinay.sajip, r.david.murray, Carl.Crowder
2011-05-24 17:06:35vinay.sajipsetmessageid: <1306256795.63.0.0227189932814.issue12168@psf.upfronthosting.co.za>
2011-05-24 17:06:35vinay.sajiplinkissue12168 messages
2011-05-24 17:06:34vinay.sajipcreate