-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
bugIncorrect, unexpected, or unintended behavior of existing codeIncorrect, unexpected, or unintended behavior of existing codelayoutsAffects one or more Layout pluginsAffects one or more Layout pluginsruntimeSpecific to the runtime environmentSpecific to the runtime environment
Milestone
Description
Description
When on the client side you activate the $PreserveFQDN property on /etc/rsyslog.conf , the logs do not include the FQDN and only include the host
Configuration
My rsyslog.conf configuration (everything is default except the parameter)
$PreserveFQDN on
The /etc/hosts file
127.0.0.1 host.app.example host
And the log4j2 configuration
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="LogToConsole" target="SYSTEM_OUT">
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n" />
</Console>
<Syslog name="RFC5424" format="RFC5424" host="localhost" port="514" protocol="TCP" appName="app" includeMDC="true" facility="LOCAL0" enterpriseNumber="18060" newLine="true" messageId="app-ID" mdcId="mdc" id="app-MDCID" connectTimeoutMillis="1000" immediateFail="true" reconnectionDelayMillis="5000">
<LoggerFields>
<KeyValuePair key="thread" value="%t" />
<KeyValuePair key="priority" value="%p" />
<KeyValuePair key="category" value="%c" />
<KeyValuePair key="exception" value="%ex" />
<KeyValuePair key="message" value="%m" />
</LoggerFields>
</Syslog>
</Appenders>
<category name="org.springframework.beans">
<priority value="info" />
</category>
<Loggers>
<Logger name="foo.example.ErrorService" additivity="false">
<AppenderRef ref="RFC5424" />
<AppenderRef ref="LogToConsole" />
</Logger>
</Loggers>
</Configuration>
Version: [Log4j version]
2.17.0
Operating system: [OS and version]
SUSE Linux Enterprise Server 12 SP3
JDK: [JDK distribution and version]
OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)
Logs
2023-08-24 14:01:49.569 host app[4539] [status] Starting...
Reproduction
Activating the $PreserveFQDN on parameter and having in /etc/hosts an FQDN longer than the normal host should be enough, but ask any questions you may have
Metadata
Metadata
Assignees
Labels
bugIncorrect, unexpected, or unintended behavior of existing codeIncorrect, unexpected, or unintended behavior of existing codelayoutsAffects one or more Layout pluginsAffects one or more Layout pluginsruntimeSpecific to the runtime environmentSpecific to the runtime environment