Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions pyanaconda/anaconda_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def filter(self, record):


class AnacondaLog:
SYSLOG_CFGFILE = "/etc/rsyslog.conf"
SYSLOG_CFGFILE = "/etc/rsyslog.d/anaconda.conf"

def __init__(self, write_to_journal=False):
self.remote_syslog = None
Expand Down Expand Up @@ -312,16 +312,21 @@ def updateRemote(self, remote_syslog):
cfgfile.write(forward_line)
self.restartSyslog()

SYSLOG_TEMPLATE = (
'$template anaconda_syslog, "%timestamp:8:$:date-rfc3164%'
',%timestamp:1:3:date-subseconds%'
' %syslogseverity-text:::uppercase% %programname%:%msg%\\n"\n'
)

def setupVirtio(self, vport):
"""Setup virtio rsyslog logging.
"""
template = "*.* %s;anaconda_syslog\n"

if not os.access(vport, os.W_OK):
return

with open(self.SYSLOG_CFGFILE, 'a') as cfgfile:
cfgfile.write(template % (vport,))
cfgfile.write(self.SYSLOG_TEMPLATE)
cfgfile.write("*.* %s;anaconda_syslog\n" % vport)
self.restartSyslog()


Expand Down