In this section:
Introduction
This extension connects to Virtualize's event monitoring component and logs events in a file on disk.
Requirements
- Virtualize 9.10 or later (including SOAtest/Virtualize combined distributions)
Installation
Download the extension from the Parasoft Marketplace. There are two approaches for installing the extension:
- Extract the .zip into the Virtualize desktop root installation (same directory as the soavirt or virtualize executable).
- Extract the .zip to any location. This approach requires Java to be installed on the path in order to run.
Running the Tool
Use the scripts shipped with the tool to start and stop it.
To start, run loggerstart.<bat|sh>
To stop, run loggerstop.<bat|sh>
Configuration
You can configure the following settings in the logger.properties file.
consumerId=<logger_name>
Sets the name of the consumer ID. Used when connecting to ActiveMQ. It changes to the name of the JMS consumer when connecting to the event broker. Do not change from the default unless it is required.
Default is logger
desktopEdition=<true|false>
Set to true
when connecting to a licensed desktop distribution of Virtualize. Setting to false
will result in the logger accessing the REST API to get the broker connection information.
Default is true
host=<host>
Sets the Virtualize host for establishing the connection.
Default is localhost
virtualizePort=<port>
Sets the Virtualize port for accessing the REST API that fetches the broker settings. Use when desktopEdition=false
.
Default is 9080
activeMQPort=<port>
Sets the port for connecting to the event monitoring broker. Use when desktopEdition=true
.
Default is 9617
logDirectory=<path>
Sets the absolute file path where log files will be written. This setting is required.
logName=<file_name>
Sets the name of the file to log to when logging to a single file.
Default is events.log
logAsOneFile=<true|false>
Specifies whether the logger writes to a single or multiple files. Set to false
to create a separate file per event.
Default is false
logAsOneLine=<true|false>
Specifies whether the event contents should be compressed into a single line or should include line breaks.
Default is false
logTimestamp=<true|false>
Specifies whether a timestamp of when the logger logged the event (local time) should be included.
Default is true
logEventTimestamp=<true|false>
Specifies whether a timestamp of when the event occurred on the server (server time) should be included as part of the event output in the log.
Default is true
logVirtualizeInfo=<true|false>
Specifies whether info-level events should be logged.
Default is true
logHeaders=<true|false>
Specifies whether the event header section should be included in the event output.
Default is true
logBody=<true|false>
Specifies whether the event body section should be included in the event output.
Default is true
logDelimiter=|
Sets the delimiter character used between sections (timestamp, header,body, and so on) when logging to single line.
Default is |
shutdownPort=<port>
Sets the port that the logger waits for a connection on to indicate it should shutdown.
Default is 9700
Example Configuration
You can use the following example configuration as a starting point for your logger.properties file:
consumerId=logger desktopEdition=true host=localhost #virtualizePort=9080 activeMQport=9617 logDirectory=C:\\User\logs\ logName=events.log logAsOneFile=false logAsOneLine=false logTimestamp=true logEventTimestamp=true logVirtualizeInfo=true logHeaders=true logBody=true logDelimter=| shutdownPort=9700