ENH: For syslog use SYSLOG_PID over _PID in systemd journal log format

pull/697/head
Steven Hiscocks 2014-04-16 23:58:00 +01:00
parent c2289bc8fe
commit 9d6fc6eca2
1 changed files with 3 additions and 2 deletions

View File

@ -167,8 +167,9 @@ class FilterSystemd(JournalFilter): # pragma: systemd no cover
logelements.append(logentry['_HOSTNAME'])
if logentry.get('SYSLOG_IDENTIFIER'):
logelements.append(logentry['SYSLOG_IDENTIFIER'])
if logentry.get('_PID'):
logelements[-1] += ("[%i]" % logentry['_PID'])
if logentry.get('SYSLOG_PID') or logentry.get('_PID'):
logelements[-1] += ("[%i]" % logentry.get(
'SYSLOG_PID', logentry['_PID']))
logelements[-1] += ":"
elif logentry.get('_COMM'):
logelements.append(logentry['_COMM'])