Installations that are based on the DEB distribution (Debian, Ubuntu and derivatives) can be configured with a workaround as follows (note that upgrading to Openfire 4.6.5 remains the preferred solution).
These installs typically have a configuration file in /etc/default/openfire
that can be used to apply additional configuration to Openfire. The default file looks something like this:
# Defaults for openfire initscript
# sourced by /etc/init.d/openfire
# installed at /etc/default/openfire by the maintainer scripts
#
# This is a POSIX shell fragment
#
# If you wish to override the auto-detected JAVA_HOME variable, uncomment
# and change the following line.
#JAVA_HOME=/usr/java/default
# Additional options that are passed to the Daemon.
DAEMON_OPTS=""
Modify the value of the DAEMON_OPTS
property to include the -Dlog4j2.formatMsgNoLookups=true
directive. Make sure that the line does not start with a #
character. If your instance was already using the DAEMON_OPTS
line, then add the new option to the existing values, separating them with a whitespace character (ensure to include everything within the quote "
characters).
The new file content could look something like this:
# Defaults for openfire initscript
# sourced by /etc/init.d/openfire
# installed at /etc/default/openfire by the maintainer scripts
#
# This is a POSIX shell fragment
#
# If you wish to override the auto-detected JAVA_HOME variable, uncomment
# and change the following line.
#JAVA_HOME=/usr/java/default
# Additional options that are passed to the Daemon.
DAEMON_OPTS="-Dlog4j2.formatMsgNoLookups=true"
After saving the file, restart Openfire (note this will briefly interrupt service).
# systemctl restart openfire
To check if your changes were successful issue the following command:
# ps ax | grep openfire
The output should include the formatMsgNoLookups
option, like in the example below:
3173 ? Sl 0:02 /bin/java -Dlog4j2.formatMsgNoLookups=true -server -DopenfireHome=/usr/share/openfire -Dlog4j.configurationFile=/usr/share/openfire/lib/log4j2.xml -Dopenfire.lib.dir=/usr/share/openfire/lib -classpath /usr/share/openfire/lib/startup.jar -jar /usr/share/openfire/lib/startup.jar
3193 pts/0 S+ 0:00 grep openfire