If something goes wrong and you can’t find out why it is not working as expected, you might want more detailed debugging options switched on.
Tigase is a Java application and it uses Java logging library, this gives you the flexibility to switch logging on for selected Java packages or even for a single Java class.
Logs files are stored in logs/ directory. tigase-console.log stores basic log data, but is the main log file. tigase.log.N files keep all the detailed logging entries. So this is the place where you should look in case of problems.
The easiest way to change logging for Tigase is modifying in init.properies following line:
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:
Note, you can skip the tigase. part.
You can also have debugging switched on for many packages/classes at the same time:
Other packages you might be interested in are:
tigase.cluster would print all the clustering related stuff. So if you have clustered installation you might be interested in debug settings:
This method, however has 2 main disadvantages:
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
If you want to modify debugging settings without regenerating the whole XML config file, you can modify it yourself by manually adding debug entries. This must be done very carefully or you could break the XML file and configuration won’t work.
Open the XML config file with a good text editor (or XML editor) and find the line:
Below is a list of all logging settings.
<entry value="INFO" type="String" key=".level"/>
Which says: INFO debug level for all the code which gives you very little debugging information. For example your init.properties line --debug=server adds one extra line in there:
<entry value="ALL" type="String" key="tigase.server.level"/>
You can add a similar line changing only "key" attribute. If you need to switch logging on for a specific class - tigase.xmpp.XMPPIOService for example, add:
<entry value="ALL" type="String" key="tigase.xmpp.XMPPIOService.level"/>
You can also put there your own package or class name. After you changed the config file you will have to restart the server.
Note, don’t overdose the debugging or your logs will be loaded with useless information.