Skip to main content

Enabling the JSON Format for Log Files

In order to obtain logs in JSON format, you first have to enable the JSON format in the config files for each log that provides this option.

For example for the Scans Manager logs, you have to enter the bin folder (C:\Program Files\Checkmarx\Checkmarx Scans Manager\bin) and locate the logging config file, in this case ScansManager.logging.config and set "jsonFormat" to true. You are able to generate logs in JSON format and the plain text format or just in JSON format. In addition, you can define, which elements of the log structure to show or hide.

To generate the log in JSON format only:

1. Navigate to the relevant bin folder, for example C:\Program Files\Checkmarx\Checkmarx Scans Manager\bin and open the logging config file, in this case ScansManager.logging.config with your text editor.

2. Set "jsonFormat" to true.

3. To show results for the desired elements of the JSON log, set them to true as well, for example to display the Correlation results, set "showCorrelation" to true.

4. Save the file.

To generate the log in plain text and JSON format:

1. Duplicate the relevant code section, for example

2. In the duplicated section, under "path", define a different path for example for the JSON log. The path might be something like "path": "$rootDir$/../../Logs/ScansManager/JSON" while the path in the example above specifies the location for the log in plain text format.

3. Set "jsonFormat" to true and enable the elements of the JSON log that you want to be displayed as outlined above.

4. Save the file.

Notice

To display part or some aspects of the log (for example ERROR level in JSON format and the rest in plain text format, set "minimumLevel" to the respective level. For example, for JSON format, set "minimumLevel" to "ERROR" and for the part to be generated in plain text format, set it to "Information".

Example for the Scans Manager log: