Fixing log4j in Openfire

Even the latest Openfire server has a bug somewhere in its configuration that prevents some logs from being written. Fix follows.

I love Openfire, at least until it bites me.

Openfire is probably the best XMPP server available. Written in Java and able to run without a separate application server, it is stable and reliable. Its plugin architecture also makes it emminently extensible.

Of course nothing is perfect, and that includes Openfire.

One annoyance I tripped over months into my first beta test was that the log4j subsystem wasn’t able to write some log files, a fact that showed up consistently in the message logs for the server.

The fix was to replace references to a variable that was supposed to stand in for the server installation home with something a bit more direct.

Basically all I needed to do was edit the file $OPENFIRE_HOME/lib/log4j.xml and replace all references to {openfireHome} with “../”, so the file looked something like this:

<param name="File" value="../logs/debug.log" />
* * *
<param name="File" value="../logs/info.log" />
* * *
<param name="File" value="../logs/warn.log" />
* * *
<param name="File" value="../logs/error.log" />

Once this change was made I restarted Openfire and it happily began writing its logs to $OPENFIRE_HOME/logs.

This entry was posted in System Administration on by .

About phil

My name is Phil Lembo. In my day job I’m an enterprise IT architect for a leading distribution and services company. The rest of my time I try to maintain a semi-normal family life in the suburbs of Raleigh, NC. E-mail me at philipATlembobrothersDOTcom. The opinions expressed here are entirely my own and not those of my employers, past, present or future (except where I quote others, who will need to accept responsibility for their own rants).