This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author zmk
Recipients vinay.sajip, zmk
Date 2012-04-05.11:55:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1333626940.36.0.176923827088.issue14452@psf.upfronthosting.co.za>
In-reply-to
Content
The 'msg' in SysLogHandler does not correspond to MSG in RFC.
Nor to %(message)s in log record.

RFC:
------------------------
SYSLOG-MSG      = HEADER SP STRUCTURED-DATA [SP MSG]
HEADER          = PRI VERSION SP TIMESTAMP SP HOSTNAME
                  SP APP-NAME SP PROCID SP MSGID
PRI             = "<" PRIVAL ">"
[...]
MSG             = MSG-ANY / MSG-UTF8
MSG-ANY         = *OCTET ; not starting with BOM
MSG-UTF8        = BOM UTF-8-STRING
BOM             = %xEF.BB.BF
--------------------------------

logging:

The SysLogHandler does not provide any fields after PRI.
Which is OK, those can be added via format string.

We are using following formatter to get RFC-like structure
to message:

  [formatter_syslog]
  format=%(hostname)s %(service_name)s %(job_name)s %(message)s

That's not fully compliant, but that's beside the point.
The problem is that SysLogHandler puts BOM before hostname
not before %(message)s.  In Python 2.6 it put it even before PRI,
which was even more annoying.

I see 2 solutions to this:

1) Stop putting BOM at all, its not necessary.
2) Put the BOM into %(message)s somehow, thus working with whatever
format is given.
History
Date User Action Args
2012-04-05 11:55:40zmksetrecipients: + zmk, vinay.sajip
2012-04-05 11:55:40zmksetmessageid: <1333626940.36.0.176923827088.issue14452@psf.upfronthosting.co.za>
2012-04-05 11:55:39zmklinkissue14452 messages
2012-04-05 11:55:39zmkcreate