Log

Log action type is used to check the contents of the payload in the gateway log for tracking and auditing.

Create a rule in the child node of the extract rule defined for the payload. The payload can be defined for services, such as, HTTP, SFTP, REST, and so on. When the extract rule is invoked for the payload, the log rule will display the contents of the payload in the gateway log.

The fields for the Logs action type are as seen in the following figure.

The properties for the Log action are explained in the following table.

PropertiesDescription
Level*Type of log to be generated. The type of log selected in this field decides the log entry that is displayed on the Audit screen in Forensics.
Destination**Location where the log file is sent to is specified in this field.
Title FormatUsed to format log message title using rule %(name) as a variable. Only applicable to destinations that support title.
Message FormatUsed to format log message using %(value) as a variable. Value represent the data extracted by parent rule.

* -In the Log action, depending on the severity of the message, you can define different types of log levels. The following table shows the DSG log level setting and the corresponding log entry that is seen in Forensics.

DSG Log LevelLogging in Forensics
WarningNormal
ErrorHigh
VerboseLowest
InformationLow
DebugDebug

** The following options are available for the Destination field:

  • Forensics: Log is sent to the Forensics and the DSG internal log.
  • Internal: Log is sent only to the DSG internal log.

Consider the following example to understand the functionality of the Log action type. In this example, the Log action type functionality is used to find the transactionID from a sample text message in the HTTP payload. The following RuleSet structure is created to find the transactionID:

  1. Create an extract rule for the HTTP payload using the default RuleSet template defined under the REST API service. The HTTP payload consists of the following sample text message:

    {"source":{"merchantId":"LCPLC-lphf21","storeId":"LPHF2100303086",
    "terminalId":"0","operatorId":"10","terminalType":"GASPRO",
    "offline":false},
    "message":{"transactionType":"WALLET","messageType":"VERIFYPARTNER",
    "transactionTime":"2018-05-09T11:48:47+0000",
    "transactionId":"20180509114847LPHF2100301237000090"},
    "identity":{"key":"4169671111","entryType":"KEYEDOPERATOR"}}
    
  2. The fields for the extract rule for the HTTP message payload are as seen in the following figure:

  3. Create a child extract rule to extract the text message in the payload.

    1. Create a RegEx expression, “transactionID”:(.*)", to match the pattern for the transactionID. The fields for the child extract rule are as seen in the following figure:

  4. Create another child rule for the Log action type. The fields for the Log action type are as seen in the following figure:

  5. Add the following values in the Log action type.

    1. Action: Log
    2. Level: Warning
    3. Destination: Internal
    4. Title Format: %(name)s
    5. Message Format: %(value)s
  6. After the log rule is processed, the following message will be displayed in the DSG internal log:

Last modified February 7, 2025