How to Get the Most From Weave Logging

Weave logs can give you a lot of information to help you deal with problems if they arise in your Weave installation. Here are a few pointers that can help you get the most out of your Weave logging.

As of Weave 2.6.7, the logging system for Weave has changed from log4j to Logback. So while this page may refer to log4j (instead of Logback) and logging.properties (instead of logging.xml), the information is still relevant and has been extended to reflect the change in logging library, Refer to the Administration Guide Logging page for more information.

 

Step-by-step guide

  1. In most cases the first step in resolving issues with Weave involves looking at the weave.log file (in the ...\weave\logs\ folder) and searching for any ERROR or WARN messages that may be related to the problem being experienced. This file keeps a running log of what Weave is doing at any moment, and by triggering the action that's causing the problem and then looking at the last few lines that were written to the log file, it may be possible to determine the cause of the problem.

    1. This is assuming that logging to weave.log is enabled, which it was by default prior to Weave 2.6.7. As of Weave 2.6.7, by default weave.log output is only generated when Weave is run from a service/daemon, if it is not then the output will be sent to the console window. But this can be changed by editing the default logging.xml file.

    2. As of Weave 2.6.7, detailed log information is always available via the Log Tool in the Admin Tool and also via the "dump logs" OSGi console command, independent of the weave.log file.

  2. If you have administration access to the Weave server then you can change the logging level yourself. This is done by changing a parameter in the logging.properties files (in the ..\weave\platform\workspace folder) to one of the settings as shown below. Enabling the DEBUG log level is important when trying to identify the cause of a problem, and can be done on a running system without having to restart Weave (though you have wait for up to 30 seconds for the change to be registered). 

    Logging for problem debugging and installation

    log4j.rootCategory=DEBUG, stdout, file, admin

     

    Logging for normal operation

    log4j.rootCategory=INFO, stdout, file, admin

     

    For Weave running as a service output to log file and Admin Tool only

    log4j.rootCategory=INFO, file, admin
    1. For Weave 2.6.7 and later, this is done in logging.xml and the root log level is always set to debug so you must set the log level within each appended to change the level. The root category tag lists the logging appenders that are used to generate the different types of log output and by default use configuration options to try and determine the best type of log output depending upon where Weave is running, e.g. from the console, as a service, within an IDE. But this can be changed to remove the conditions and allow you to directly choose which types of log output your require.

  3. If your initial investigation of the weave.log file doesn't reveal anything then the following method should be followed:  
    1. Ensure that the logging level in the ...\weave\platform\workspace\logging.properties file is set to DEBUG (this includes both the log4j.rootCategory and log4j.appender.file.Threshold settings).
    2. Stop Weave.
    3. Delete ...\weave\logs\weave.log.
    4. Start Weave.
    5. Perform the action that causes the problem.
    6. Log a Support Ticket and include the weave.log file to us (after compressing it if it's large).

    This method asks for Weave to be stopped and the log file cleaned out so that we can ensure that the log file covers as little as possible other than what is related to the problem since log files can grow quite large. If the problem is being experienced on a production system then it's not essential that the log file be cleaned out since Weave cannot be stopped. But, enabling the DEBUG log level is important, and can be done without having to restart Weave.

    1. This still applies for Weave 2.6.7 and later, it's just the changes are made to logging.xml, not logging.properties

  4. Use the Log Tool in the Weave Administration Tool to view the debug, information, warning and error statements from your Weave while it's in operation. 

  5. By default the Weave log file will not contain the date of the entry written in the log file, just the time, as there is a new log file created every day. However if you need the date of the log entry recorded in your log file then you can make this change in the logging.properties files (in the ..\weave\platform\workspace folder) as shown below.

    Default log file parameters

    Change the ConversionPattern setting (in the last line) as shown below.

    Log file with date for each entry

    The same change can be applied to other logging methods you have defined in your logging.properties file (e.g. log4j.appender.stdout, log4j.appender.email).

    1. This is no longer the default in Weave 2.6.7 and later, the full date and time of the log event is recorded in the log file.

  6. If you are running a search and it's not giving you the results you are expecting then it's good to see the actual SQL command that is being sent to the database. Search for "NativeSQL" in your log file, copy the SQL statement, and run it in your database query software or in the Data Source SQL tool in the Weave Administration Tool.

  7. If you are having problems on the Weave client side (browser) you can get more information returned from the browser. To do this add ";debug" to the startup URL (e.g. http://server1:8080/weave/main.html;debug). Pressing the F12 key, in Internet Explorer, once Weave is open, will open up the browser console and display any client side errors. Restarting Weave with the normal URL will return it to the standard way of operating.  

 

Learn to love your log files!

Related articles