Message Logging

You can log request and response data generated during learning, simulation, and standby modes. Message logging can also be used for data model validation.

Message logs enable you to:

  • Review the messages more closely to troubleshoot problems you may have.
  • Check the responses generated for specific requests.
  • Save and share logged messages with other users.
  • Examine protocol data that is not stored elsewhere.

(Prerequisite): Enable logging

Enable message logging for a virtual service.

In the Virtual Service Editor, under Service Debugging, toggle the Message Logging switch to Enabled.

As of SV version 5.3, the logged messages are stored in the database (together with virtual service data).

Note:  

  • The message logging state (enabled/disabled) in the Designer or Service Virtualization Management is loaded when the virtual service is first opened. If the state is changed in the Designer or SVM, the state change may not display in the other instance of the Designer or SVM until the service page is reopened.

  • Message logs store raw message data. If you configure data masking in the virtual service, message logging will be automatically disabled.

    You can modify the default behavior, so that messages will be logged and a warning written to the Problem List. To enable message logging even if data masking is configured in the virtual service, edit the following line in the Designer or Server application configuration file:

    <add key="MessageLogger.LogMessagesWithDataMaskingEnabled" value="False" />

    Set value="True".

  • Logged messages (including simulation reports) are kept by default for 30 days. You can change the retention period in the Designer or Server application configuration file:

    <add key=SV.DebuggingStorage.MaxAge" value="30" />

Back to top

View log files in the Designer message viewer

In the Virtual Service Editor, under Service Debugging, click Show Service Logs to open the message viewer.

By default, the message viewer displays 20 request and response pairs in the list. To view more items, click Fetch more items.

Filtering: Use the filter options to limit the messages displayed. By default, the viewer displays messages from the current date, or the last date on which messages were logged.

Comparing: Use the left and right views to compare messages. You can select either a request or a response. When a request message is forwarded from SV to the real service, you can compare the original message from the client with the forwarded message. The same applies for responses. In case of complex messages, you can use the Compare link which invokes an external Diff Viewer.

Back to top

Save logs to your local machine

  1. In the Virtual Service Editor, under Service Debugging, click Show Service Logs to open the message viewer.
  2. Click Save raw [request/response] data and selection a location.

Back to top

Import logged messages to the Data Model

  1. In the Virtual Service Editor, under Service Debugging, click Show Service Logs to open the message viewer.
  2. Select messages to import.
  3. Go to the Data Model Editor and expand a rule. You can import messages into the Learned Data rule or a custom rule.
  4. Expand the rule, right-click inside the rule, and select Import Selected Logged Messages. You can select to import the request part of the messages, the response part, or entire messages.

Back to top

Import logged messages from Project Archive

If you have a project archive with logged messages, you can use it to import its logged messages. This enables you to import the logged messages to a different SV server than the one on which the archive was created.

To import the logged messages, select the project in Virtualization Explorer, right click and select Import Logged Messages…. SV displays a dialog box when you need to specify the location of the .vproja archive.

Note: Importing logged messages from a project archive deletes all existing logged messages.

Back to top