#10441 closed defect (wontfix)
Trac syslog logger prefixes program name with U+FEFF byte-order mark, doesn't seem right
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | general | Version: | 0.12.2 |
Severity: | normal | Keywords: | logging |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
it should be possible to filter Trac with a sane syslog configuration entry like:
... filter f_trac { program("^Trac"); } ...
to my surprise this didn't capture traffic into a separate log file, while tailing /var/log/messages didn't show anything suspicious.
it was less, who showed me that this U+FEFF marker is placed in front of every Trac syslog entry.
... <U+FEFF>Trac[project:env] INFO: -------------------------------- environment startup [Trac 0.12.2] -------------------------------- ...
i'm following wiki instructions:
[logging] log_format = Trac[$(basename)s:$(module)s] $(levelname)s: $(message)s
this marker seems to be in the wrong place at the wrong time and should be eliminated. thoughts?
Attachments (0)
Change History (4)
comment:1 by , 13 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
comment:2 by , 13 years ago
Thanks for clearing this up cboos. This turned out to be an unexpected development (design, not bug! lol) but I guess I have some clues now to look for how smarter folks have solved this.
comment:4 by , 12 years ago
Thanks for the link! This means the next version of Python (2.7.4) will have the fix (http://hg.python.org/cpython/rev/af46a001d5ec).
(while on the train of #10538 ;-) )
I didn't comment yet because I wasn't sure I found the proper authoritative document on this, but from what I recall, all seem to indicate that Python logging system does the right thing. See in particular python-issue:7077#msg94141 (well, Python 2.7.1 at least: http://hg.python.org/cpython/file/v2.7.1/Lib/logging/handlers.py#l782).
And yes, that's what the RFC:5424#section-6.4 says… so I guess you have to see how your filtering program can represent this BOM!
Not much we could do in Trac anyway, besides monkey-patching
logging
, which we won't do.