The easy way - init.properties file

The easiest way to change logging for Tigase is modifying in init.properies following line:

--debug=server

The line above says: "Switch on ALL debug messages for packet: tigase.server". The tigase.server packet keeps all it’s component’s classes, so it allows you to monitor what is going on in each component, what packets it receives and what it is sending out.

Usually people want to see what is going on the network level. That is what has been sent and what has been received by the server - the actual character data. The class which would print all received and sent character data is: tigase.xmpp.XMPPIOService. To enable all debugging info for this class you have to modify the debug line:

--debug=xmpp.XMPPIOService

Note, you can skip the tigase. part.

You can also have debugging switched on for many packages/classes at the same time:

--debug=server,xmpp.XMPPIOService

Other packages you might be interested in are:

  • tiagse.io and tigase.net which can print out what is going on a very low level network level including TLS/SSL stuff.
  • tigase.xml would print the XML parser debugging data.
  • tigase.cluster would print all the clustering related stuff. So if you have clustered installation you might be interested in debug settings:

    --debug=server,cluster
  • tigase.xmpp.impl would print logs from all plugins loaded to Tigase server.

This method, however has 2 main disadvantages:

  1. You have to remove your XML config file and regenerate it which might be inconvenient. (only applicable to versions before 5.0.0)
  2. You can’t set logging this way for classes and packages other than Tigase. This might be a problem if you include your own code in and load it into the server.

To enable logging for your own packages from packages different than Tigase, you have to use another option which has been made available for this:

--debug-packages = your.com.package

You can also specify more parameters for the Tigase logging mechanisms like the file size, number of files rotated, and location where all Tigase logs are stored. The following lines are some examples of those filters using lines in the init.properties file:

basic-conf/logging/java.util.logging.FileHandler.limit=100000000
basic-conf/logging/java.util.logging.FileHandler.count=20
basic-conf/logging/java.util.logging.FileHandler.pattern=/var/log/tigase/tigase.log