Permalink
Browse files

Documented syslog_address and allowed it to accept lists so it works …

…with sockets
  • Loading branch information...
1 parent 7d69c94 commit 2befd01d42546c9d5d277c5a0d673f958004c513 Stephen Johnson committed Nov 7, 2011
Showing with 12 additions and 0 deletions.
  1. +8 −0 docs/tronfig.1
  2. +4 −0 tron/config.py
View
@@ -28,6 +28,7 @@ Field are described below:
.IP "Top Level Sections of Configuration"
ssh_options
+ syslog_address
notification_options
nodes
command_context
@@ -39,6 +40,13 @@ These options are how we connect to the nodes we run commands on.
agent - (optional) boolean to indicate we should use an SSH Agent
identities - (optional) list of paths to SSH identity files
+.IP syslog_address
+Include this if you want to enable logging to syslog. Typical values for
+various platforms are:
+ Linux: "/dev/log"
+ OS X: "/var/run/syslog"
+ Windows: ["localhost", 514]
+
.IP notification_options
Who to email failures to.
smtp_host
View
@@ -226,12 +226,16 @@ def _apply_loggers(self, mcp):
new_handlers = []
if hasattr(self, 'syslog_address'):
+ if not isinstance(self.syslog_address, basestring):
+ self.syslog_address = tuple(self.syslog_address)
+
already_exists = False
for h in list(handlers_to_be_removed):
if (isinstance(h, handlers.SysLogHandler) and
h.address == self.syslog_address):
handlers_to_be_removed.remove(h)
already_exists = True
+
if not already_exists:
new_handlers.append(handlers.SysLogHandler(self.syslog_address))

0 comments on commit 2befd01

Please sign in to comment.