[
https://issues.apache.org/jira/browse/LOG4J2-3225?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Martin Schröder closed LOG4J2-3225.
-----------------------------------
Resolution: Not A Problem
Turns out that this is not a log4j2 issue.
Changing the rsyslog rule (replacing syslogtag with programname) solved the
problem.
> Syslog appender: syslogtag contains pid of process
> --------------------------------------------------
>
> Key: LOG4J2-3225
> URL: https://issues.apache.org/jira/browse/LOG4J2-3225
> Project: Log4j 2
> Issue Type: Bug
> Components: Appenders
> Affects Versions: 2.15.0
> Reporter: Martin Schröder
> Priority: Major
>
> We have recently upgrade our projects from 2.8.2 to 2.15.0
> We use the syslog appender with this configuration:
> {code}
> <Syslog name="syslog" format="RFC5424" host="localhost" port="514"
> protocol="UDP"
> appName="herodotus" mdcId="mdc" includeMDC="true"
> facility="LOCAL0" connectTimeoutMillis="100" ignoreExceptions="false">
> <LoggerFields>
> <KeyValuePair key="class" value="%c{1.}"/>
> <KeyValuePair key="exception" value="%ex{full}"/>
> </LoggerFields>
> </Syslog>
> {code}
> This is then forwarded to a log host via rsyslog.
> Config on the sender:
> {code}
> $ModLoad imudp
> $UDPServerRun 514
> #
> if $syslogfacility-text == 'LOCAL0' then {
> @magpie;RSYSLOG_SyslogProtocol23Format
> stop
> }
> {code}
> Config on the receiver:
> {code}
> module(load="mmpstrucdata")
> action(type="mmpstrucdata")
> $template java_messages, "/var/log/techonair/%syslogtag%/messages"
> template(name="herodotus" type="string"
> string="%timereported:::date-rfc3339% %syslogseverity-text:::uppercase%
> requestId[%$!rfc5424-sd!mdc@18060!requestId%] : %msg% :
> {%syslogtag%@%hostname%} {Class:%$!rfc5424-sd!mdc@18060!class%}
> %$!rfc5424-sd!mdc@18060!exception%\n")
> if $syslogtag startswith 'herodotus' then {
> ?java_messages;herodotus
> stop
> }
> {code}
> Since 2.15.0 the created directory name contains the PID of the sending
> process, e.g. herodotus[5891]. This is not wanted and a regression from
> 2.8.2, where it was only the application name _without the PID_.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)