You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
ppkarwasz
added
the
bug
Incorrect, unexpected, or unintended behavior of existing code
label
Aug 28, 2023
@Roarca,
Thanks for the report. The bug is easily reproducible if the system call gethostname() returns an unqualified host name.
We use InetAddress#getLocalHost() to retrieve the local hostname, which calls gethostname(), performs a lookup for the fully qualified hostname and ignores the result (cf. source code).
This is why you see just host as hostname.
As a workaround, you can change the hostname of the machine:
hostname host.app.example
It is not the UNIX way, but most services should work without any problems. You can also use uts_namespaces to isolate the hostname of your app from the rest of the system.
Since RFC5424 specifies that the
[`HOSTNAME`](https://datatracker.ietf.org/doc/html/rfc5424#section-6.2.4)
field should contain the FQDN of the current host,
we add a `useFqdn` configuration attribute to RFC5424
Layout that replaces the usage of `InetAddress.getHostName()`
with `InetAddress.getCanonicalHostName()`.
Closes#1740.
Since RFC5424 specifies that the
[`HOSTNAME`](https://datatracker.ietf.org/doc/html/rfc5424#section-6.2.4)
field should contain the FQDN of the current host,
we replace replace the usage of `InetAddress.getHostName()`
with `InetAddress.getCanonicalHostName()`.
Closes#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)
$PreserveFQDN on
The /etc/hosts file
And the log4j2 configuration
Version: [Log4j version]
Operating system: [OS and version]
JDK: [JDK distribution and version]
Logs
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
The text was updated successfully, but these errors were encountered: