Message157572
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. |
|
Date |
User |
Action |
Args |
2012-04-05 11:55:40 | zmk | set | recipients:
+ zmk, vinay.sajip |
2012-04-05 11:55:40 | zmk | set | messageid: <1333626940.36.0.176923827088.issue14452@psf.upfronthosting.co.za> |
2012-04-05 11:55:39 | zmk | link | issue14452 messages |
2012-04-05 11:55:39 | zmk | create | |
|