Roarca opened a new issue, #1740:
URL: https://github.com/apache/logging-log4j2/issues/1740

   ## 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)
   ```txt
   $PreserveFQDN on
   ```
   The /etc/hosts file
   ```txt
   127.0.0.1 host.app.example host
   ```
   
   And the log4j2 configuration
   ```xml
   <?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
   
   ```log
   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
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to