Writing to the xfServerPlus log

Note

You must explicitly create a connection with the connect() method to use setUserString() or getUserString().

Use the setUserString() method to pass a user string that is written in the xfServerPlus log. This string is stored, and the value set can be retrieved with getUserString(). You can, for example, use this method to write the current client in the log.

To use this method, server‑side logging must be enabled (see Using server‑side logging) and there must be an entry for the XFPL_LOG subroutine in the SMC. By default, XFPL_LOG is included in the SMC; see Using the xfServerPlus application program interface.

For example, if your login routine stored the user name in a string called username, you could write it to the log like this:

appLog.setUserString(username);

You can then retrieve the string you set. Note that getUserString() only gets the string from setUserString(); it does not retrieve it from the xfServerPlus log. For example:

String abc = new String();
abc = appLog.getUserString();