summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2006-03-01 20:38:10 +0000
committerNarayan Desai <desai@mcs.anl.gov>2006-03-01 20:38:10 +0000
commit8273814ec11db11c23efd330acc87723d2b8fd5c (patch)
tree082bdd969f6759c19f50d38f2d9bc5cf249f29b6 /src/lib
parent684a9260748240770680b388cf23cbdbb722e655 (diff)
downloadbcfg2-8273814ec11db11c23efd330acc87723d2b8fd5c.tar.gz
bcfg2-8273814ec11db11c23efd330acc87723d2b8fd5c.tar.bz2
bcfg2-8273814ec11db11c23efd330acc87723d2b8fd5c.zip
Fix syslog priority/facility encoding in log messages
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@1789 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Logging.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/Logging.py b/src/lib/Logging.py
index 5ab6d741c..980a88db4 100644
--- a/src/lib/Logging.py
+++ b/src/lib/Logging.py
@@ -105,11 +105,13 @@ class FragmentingSysLogHandler(logging.handlers.SysLogHandler):
msgs = [record]
while msgs:
newrec = msgs.pop()
+ msg = self.log_format_string % (self.encodePriority(self.facility,
+ newrec.levelname.lower()), self.format(newrec))
try:
- self.socket.send(self.format(newrec))
+ self.socket.send(msg)
except socket.error:
self.socket.connect(self.address)
- self.socket.send(self.format(newrec))
+ self.socket.send(msg)
def setup_logging(procname, to_console=True, to_syslog=True, syslog_facility='local0', level=0):
'''setup logging for bcfg2 software'''