Skip to content

Supervise SquashTM

Manage Logs

You can download SquashTM logs from the administration workspace or from the logs directory on the server. The logs of the current day are in the file squash-tm.log, whereas previous logs are suffixed with their date (example: squash-tm.log.20210527).

Log Levels

You can configure the SquashTM application log rotation in the file conf/log4j2.xml.

In SquashTM, there are three useful log levels: info, debug, and trace. The trace level is the most precise of the three, but also the most verbose.

To set SquashTM logs to debug level, you must:

  1. Stop SquashTM;
  2. In the file log4j2.xml, change the value info to debug in the line:
        <Root level="info">
    
  3. Restart SquashTM.

After running your test, revert to the info level to avoid overloading the server, as logs are very large at debug level.

SquashTM Loggers

The file log4j2.xml already contains a number of loggers. You can also modify their log level individually by changing the value of the level property.

Here is a non-exhaustive list of additional loggers that you can add after the file's last Logger tag:

To get more precise logs for the Jira Data Center bugtracker:

<Logger name="org.squashtest.tm.plugin.bugtracker.jirarest" level="trace" additivity="false" >
    <AppenderRef ref="Console"/>
    <AppenderRef ref="Daily_log"/>
</Logger>

To increase the log level for the Git Connector plugin:

<Logger name="org.squashtest.tm.plugin.scm.git.internal.GitClientImpl" level="trace" additivity="false" >
     <AppenderRef ref="Console"/>
     <AppenderRef ref="Daily_log"/>
</Logger>

(The additivity="false" parameter prevents log events from propagating to parent loggers, in particular the Root logger. Without this parameter, each log entry would appear twice in the output files.)

You must restart SquashTM for the changes made to the file to take effect.

Xsquash Logs

For Xsquash Cloud, you can download the logs directly from the Jira Cloud administration.

For Xsquash on Jira Data Center, the plugin logs are mixed in with the Jira logs.

You can add a logger in error mode for the package org.squashtest.plugin.jira.Xsquash to get a more precise view of Xsquash errors in the Jira logs.

Here are the steps to add this logger:

  1. In Jira Data Center, go to Administration > System;
  2. Go to the Logging and Profiling section;
  3. In Default Loggers, click Configure logging level for another package;
  4. Enter the package org.squashtest.plugin.jira.Xsquash and set the logging level to error.

Monitoring

Servers

As with any other application, the servers hosting SquashTM and its database should be monitored:

  • disk space: set up an alert when disk space reaches a certain threshold;
  • CPU: set up an alert when CPU usage remains high for too long;
  • RAM: same;
  • network (optionally, if there is a risk of the network being a bottleneck): same.

SquashTM

SquashTM is a Spring Boot application, so your monitoring application can use the Actuators web endpoints to query it.

For example:

  • To use the actuator/health endpoint:
    Add the following lines to the conf/squash.tm.cfg.properties file:
    management.endpoints.access.default = read-only
    management.endpoints.web.exposure.include = health
    
    The endpoint can then be queried:
    (A token can be created on the My Account page.)
    >>> curl -s -H "Authorization: Bearer <token>" https://<host>:<port>/squash/actuator/health | jq
    {
      "status": "UP"
    }
    
  • To also use the actuator/metrics endpoint:
    Modify the second line above in the conf/squash.tm.cfg.properties file:
    management.endpoints.web.exposure.include = health,metrics
    
    The endpoint can then be queried:
    >>> curl -s -H "Authorization: Bearer <token>" https://<host>:<port>/squash/actuator/metrics/tomcat.sessions.active.current | jq
    {
      "name": "tomcat.sessions.active.current",
      "description": null,
      "baseUnit": "sessions",
      "measurements": [
        {
          "statistic": "VALUE",
          "value": 4
        }
      ],
      "availableTags": []
    }
    
    (Use curl -s -H "Authorization: Bearer <token>" https://<host>:<port>/squash/actuator/metrics to get the list of available metrics.)
  • For teams using Prometheus, the actuator/prometheus endpoint is also available:
    Modify the second line above in the conf/squash.tm.cfg.properties file:
    management.endpoints.web.exposure.include = prometheus
    
    The endpoint can then be queried:
    >>> curl -s -H "Authorization: Bearer <token>" 'https://<host>:<port>/squash/actuator/prometheus?includedNames=jvm_memory_used_bytes%2Cjvm_memory_committed_bytes'
    # HELP jvm_memory_committed_bytes The amount of memory in bytes that is committed for the Java virtual machine to use
    # TYPE jvm_memory_committed_bytes gauge
    jvm_memory_committed_bytes{area="heap",id="G1 Eden Space"} 2.38026752E8
    jvm_memory_committed_bytes{area="heap",id="G1 Old Gen"} 3.31350016E8
    jvm_memory_committed_bytes{area="heap",id="G1 Survivor Space"} 1.2582912E7
    jvm_memory_committed_bytes{area="nonheap",id="CodeHeap 'non-nmethods'"} 2752512.0
    jvm_memory_committed_bytes{area="nonheap",id="CodeHeap 'non-profiled nmethods'"} 1.3893632E7
    jvm_memory_committed_bytes{area="nonheap",id="CodeHeap 'profiled nmethods'"} 2.8770304E7
    jvm_memory_committed_bytes{area="nonheap",id="Compressed Class Space"} 2.9687808E7
    jvm_memory_committed_bytes{area="nonheap",id="Metaspace"} 2.25312768E8
    # HELP jvm_memory_used_bytes The amount of used memory
    # TYPE jvm_memory_used_bytes gauge
    jvm_memory_used_bytes{area="heap",id="G1 Eden Space"} 8.1788928E7
    jvm_memory_used_bytes{area="heap",id="G1 Old Gen"} 3.00903496E8
    jvm_memory_used_bytes{area="heap",id="G1 Survivor Space"} 1.1599888E7
    jvm_memory_used_bytes{area="nonheap",id="CodeHeap 'non-nmethods'"} 2482176.0
    jvm_memory_used_bytes{area="nonheap",id="CodeHeap 'non-profiled nmethods'"} 1.3886976E7
    jvm_memory_used_bytes{area="nonheap",id="CodeHeap 'profiled nmethods'"} 2.8716672E7
    jvm_memory_used_bytes{area="nonheap",id="Compressed Class Space"} 2.856352E7
    jvm_memory_used_bytes{area="nonheap",id="Metaspace"} 2.23053752E8
    

Unavailability for SquashTM Cloud

Access to Actuator endpoints is limited to administrators.
In the SquashTM Cloud offer, these endpoints are unavailable.

Database

Many tools can be used to monitor the PostgreSQL or MariaDB database (PostgreSQL's documentation lists some of them).