Skip to content

Commit fe00b32

Browse files
authored
Merge pull request Supervisor#162 from fcuny/supervisord-to-syslog
Let the supervisord daemon log to syslog.
2 parents a31dfd3 + 1ed514b commit fe00b32

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

docs/logging.rst

+5-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ messages about its own health, its subprocess' state changes, any
1414
messages that result from events, and debug and informational
1515
messages. The path to the activity log is configured via the
1616
``logfile`` parameter in the ``[supervisord]`` section of the
17-
configuration file, defaulting to :file:`$CWD/supervisord.log`.
17+
configuration file, defaulting to :file:`$CWD/supervisord.log`. If
18+
the value of this option is the special string "syslog", the logs of
19+
the :program"`supervisord` will be routed to the syslog service
20+
instead of being written to a files. As a consequence, the options
21+
``logfile_maxbytes`` and ``logfile_backups`` will be ignored.
1822
Sample activity log traffic is shown in the example below. Some lines
1923
have been broken to better fit the screen.
2024

supervisor/options.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,11 @@ def realize(self, *arg, **kw):
501501
else:
502502
logfile = section.logfile
503503

504-
self.logfile = normalize_path(logfile)
504+
if logfile != 'syslog':
505+
# if the value for logfile is "syslog", we don't want to
506+
# normalize the path to something like $CWD/syslog.log, but
507+
# instead use the syslog service.
508+
self.logfile = normalize_path(logfile)
505509

506510
if self.pidfile:
507511
pidfile = self.pidfile

0 commit comments

Comments
 (0)