summaryrefslogtreecommitdiffstats
path: root/Lib/logging/handlers.py
diff options
context:
space:
mode:
authorBrian Curtin <brian@python.org>2011-06-13 21:10:32 (GMT)
committerBrian Curtin <brian@python.org>2011-06-13 21:10:32 (GMT)
commita87d586fd6c4a5dfe4ea89fda288ae8eb66b0134 (patch)
tree420fe483c679d2225cc8bd82eefaecf783999268 /Lib/logging/handlers.py
parentd25aef55c8b0025dd2ee7de11b526f34ceed6b66 (diff)
parentcdc751720ee7a13ac163da1eedf3a513386c98d4 (diff)
downloadcpython-a87d586fd6c4a5dfe4ea89fda288ae8eb66b0134.zip
cpython-a87d586fd6c4a5dfe4ea89fda288ae8eb66b0134.tar.gz
cpython-a87d586fd6c4a5dfe4ea89fda288ae8eb66b0134.tar.bz2
branch merge?
Diffstat (limited to 'Lib/logging/handlers.py')
-rw-r--r--Lib/logging/handlers.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py
index 306cf86..4a6b959 100644
--- a/Lib/logging/handlers.py
+++ b/Lib/logging/handlers.py
@@ -766,6 +766,8 @@ class SysLogHandler(logging.Handler):
"""
return self.priority_map.get(levelName, "warning")
+ append_nul = True # some old syslog daemons expect a NUL terminator
+
def emit(self, record):
"""
Emit a record.
@@ -773,7 +775,9 @@ class SysLogHandler(logging.Handler):
The record is formatted, and then sent to the syslog server. If
exception information is present, it is NOT sent to the server.
"""
- msg = self.format(record) + '\000'
+ msg = self.format(record)
+ if self.append_nul:
+ msg += '\000'
"""
We need to convert record level to lowercase, maybe this will
change in the future.