Monitoring, Logging & Profiling
iSQL: Built-in Interactive SQL Console
The interactive SQL console enables users to query the database, besides exporting the results in a variety of formats. The iSQL console is available by default, however System Administrators can limit the accessibility of the console by configuring the appropriate environment variable. For more information, see: Application Configuration via Environment Variables.
Figure: Example Interactive SQL Query and Results
To test the performance of the database, use the [Test Performance] button, the Number of runs the test makes can be modified.
Figure: Example Test Performance and Results
Configuring System Logging
codebeamer uses Apache Log4j for logging. While the default logging levels are carefully selected, sometimes the defaults do not provide enough information for tracking down a more complex problem in codebeamer.
Administrators can now change these log4j settings without restarting their codebeamer server by clicking on the System Admin ► Logging Configuration link.
Figure: Change Logging Configuration
Usage
To change the log4j settings of some classes or packages, paste the new log settings in the Logging changes textbox, using the same syntax as found in the installdir/tomcat/common/classes/log4j.properties file.Do not modify the log4j.properties file. The logging levels are to be changed only through System Admin ► Logging Configuration.
For example:
log4j.logger.com.intland.codebeamer.controller.admin.LoggingConfiguratorController=INFO
This configuration parameter will change the LoggingConfigurationController's logger to INFO level.
Multiple log4j settings can be changed at once by putting them in multiple lines, similarly to the log4j.properties file.
Important notes:
- Be careful when changing log levels, since very verbose logging may severely degrade the server performance.
- The changes are not reverted automatically & the administrator has to change the log levels back to their defaults.
- The changes made on these pages are not persistent and are lost when the server is restarted.
Rollover
Rollover archives the log files and creates new ones to continue logging. See more details here. Rollover happens based on the log4j configuration, by default every day - effectively separating the logs of different days. These archive files are kept either based on the CB_LOGFILE_TTL environment variable, or for 7 days by default.
Configuring Groove Script Logging
codebeamer uses Apache Log4j for logging. Groovy scripts by default have no logging at all. Users' script must have an active logger setup and write INFO or DEBUG messages to it. The Logger ID should be known by the user (for Java class, this is typically the canonical class name). For scripts, this can be anything.
1. Once the logging is enabled in the custom Groovy Script either with INFO or DEBUG level, the log messages will appear in the cb.txt logfile.
For example:
2020-05-07 06:24.21,021 INFO event.impl.CustomScriptExecutor - responsible user found BOUJMIG [WorkflowActionManager-79] [2424] {}
2020-05-07 06:24.21,022 INFO event.impl.CustomScriptExecutor - end of custom action <starc_cust_act_map_System_resp.groovy> [WorkflowActionManager-79] [2424] {}
2. Now, enable Custom Script DEBUG Logging on codebeamer side as well. Go to System Admin ► Logging Configuration page and add the following to the Logging Configuration:
log4j.logger.com.intland.codebeamer.event.impl.CustomScriptExecutor=DEBUG
3. Reproduce the issue and capture the necessary logs. Once all done do not forget to reset Custom Script Logging level back to INFO by entering:
log4j.logger.com.intland.codebeamer.event.impl.CustomScriptExecutor=INFO
Monitoring Server Resources: Memory Usage, Thread Count and Database Connections
Since codebeamer release 9.3, a Monitor application is available for monitoring codebeamer server resources.
Warning Emails About Low Available Disk Space
codebeamer has a built in functionality that periodically checks the free disk space where the codebeamer instance is running. If the disk space goes low, it sends an email to System Administrators.
The goal is to avoid running out of disk space since it can cause serious problems and data loss.
The periodic low disk check works as follows:
- It checks if the disk space is below 10 Gigabytes or below 5% of total disk space where codebeamer is installed on.
- If either one of the above happens, System Administrators will receive a warning email, with the following content:
- This warning email is sent once a day to avoid spamming the System Administrators.
- The feature is configurable in the System Admin ► Application Configuration menu, by adding the following:
"interactive" : {
"warnLowDiskSpace" : {
"emailTo" : "administrator@example.com",
"enabled" : true,
"minFreeDisk" : 90000,
"minPercentage" : 50,
"emailFrequency" :
}
},
"diskSpaceVolumes" : {
"name" : "linux",
"path" : "/dev/nvme0n1p6",
"threshold" : 90000
},
- The attributes of the warnLowDiskSpace section are:
name |
meaning |
default value |
enabled |
If the email sending is enabled? |
true |
minFreeDisk |
Minimum free disk in MB when warning starts. |
10240 (=10 Gigabytes) |
minPercentage |
Minimum percentage of the disk space. |
5 |
emailTo |
; separated list of email addresses to send warning email to. If empty then System Administrators will be notified by default. |
empty: means that System Administrators will get emails |
emailFrequency |
How often the email is sent in seconds. |
86400 (=1 day), minimum is 3600 (= 1hour) |
diskSpaceVolumes (codebeamer 10.0)
Multiple disk volumes can be monitored with this property. It has to be used together with warnLowDiskSpace.
The attributes of the diskSpaceVolumes section are:
name |
meaning |
default value |
name |
The disk's name in the warning email. |
Mandatory, has no default value |
path |
Path of disk to be monitored. |
Mandatory, has no default value |
threshold |
Minimum free space in MB that triggers the warning email. |
Default: 10240 MB |
Example for Windows
"diskSpaceVolumes" : [ {
"name" : "diskC",
"path" : "C:\\",
"threshold" : 10240
}, {
"name" : "diskE",
"path" : "E:\\",
"threshold" : 20480
}, {
"name" : "diskF",
"path" : "F:\\"
} ],
Example for Linux
"diskSpaceVolumes" : [ {
"name" : "disk1",
"path" : "/dev/sda1",
"threshold" : 10240
}, {
"name" : "disk2",
"path" : "/dev/sda2",
"threshold" : 20480
}, {
"name" : "disk3",
"path" : "/dev/sda3"
} ],