Great, thanks for the tip.
Here is the code I added src/java/org/jivesoftware/openfire/session/SessionManager.java, in two functions as follows:
public void addSession(LocalClientSession session);
public void addSession(LocalClientSession session) {
String hostAddress;
try {
hostAddress = session.getHostAddress();
} catch (UnknownHostException e) {
hostAddress = “Unknown”;
}
JID fullJID = session.getAddress();
Log.info(“User Login=” + fullJID.getNode() + “, IP=” + hostAddress + “, Resource=” + fullJID.getResource());
public boolean removeSession(ClientSession session, JID fullJID, boolean anonymous, boolean forceUnavailable);
Modified if part of code in the same way:
if (removed) {
// Fire session event.
if (anonymous) {
SessionEventDispatcher
.dispatchEvent(session, SessionEventDispatcher.EventType.anonymous_session_destroyed);
}
else {
String hostAddress;
try {
hostAddress = session.getHostAddress();
} catch (UnknownHostException e) {
hostAddress = “Unknown”;
}
Log.info(“User Logout=” + fullJID.getNode() + “, IP=” + hostAddress + “, Resource=” + fullJID.getResource());
SessionEventDispatcher.dispatchEvent(session, SessionEventDispatcher.EventType.session_destroyed);
}
}
This will log successful login and logout in info.log.