TritonHelper
The TritonHelper class provides utility methods and builder classes for the Triton logging framework.
This class is mostly for internal use and includes functionality for log level management, UUID generation, HTTP request/response serialization, and message formatting.
Utility Methods
buildLogLevelKey
Creates a key for log level based on category, type, and area parameters.
Parameters:
category
- Log category fieldtype
- Log type fieldarea
- Log functional area field
Returns:
String in the format:
Category:{0};Type:{1};Area:{2}
compareLevel
Compares two log levels to determine if logging should proceed.
Parameters:
value
- The level to compare against (from settings)toCompare
- The level being compared (from log)
Returns:
true
if value is greater than or equal to toComparefalse
if value is lower than toCompare
generateUUID4
Generates a UUID (Universal Unique Identifier) version 4. Used to create transaction IDs.
Returns:
String containing a UUID4 formatted identifier
toJson (HTTP)
Serializes HTTP request and response objects to JSON format for integration logging.
Parameters:
request
- HttpRequest instanceresponse
- HttpResponse instance
Returns:
JSON string containing formatted request and response data
toJson (REST)
Serializes REST request and response objects to JSON format for integration logging.
Parameters:
request
- RestRequest instanceresponse
- RestResponse instance
Returns:
JSON string containing formatted request and response data
formatMessage (Single Parameter)
Formats a message by replacing {0} placeholder with the provided parameter.
Parameters:
template
- Message template containing {0} placeholderparam
- Parameter to replace the placeholder
Returns:
Formatted message string
formatMessage (Multiple Parameters)
Formats a message by replacing {0}, {1}, etc. placeholders with the provided parameters.
Parameters:
template
- Message template containing numbered placeholdersparams
- List of parameters to replace the placeholders
Returns:
Formatted message string
Builder Class
PostProcessingControlsBuilder
Builder class for constructing Pharos post-processing settings. Controls various aspects of log enhancement after creation. You can find a more detailed method reference here.
Methods
Each method controls a specific aspect of post-processing:
auditTrail
- Controls fetching of recent audit traildeployResult
- Controls fetching of recent deploymentsinstalledPackages
- Controls fetching of installed package countarea
- Controls automatic functional area settingpendingJobs
- Controls fetching of pending jobs in flow queuerelatedObjects
- Controls fetching of related object namesstackTrace
- Controls stack trace enhancement (Apex/Integration logs only)userInfo
- Controls fetching of User nametotalActiveSession
- Controls fetching of current logged-in user countsetAll
- Sets all flags to the provided value
Build Method:
Returns a JSON string representation of the post-processing controls.
Example:
IntegrationWrapper
Wrapper class for integration logs used to create the JSON structure that combines HTTP objects.
Properties:
request
- Map<String, Object> containing request detailsresponse
- Map<String, Object> containing response details
This class is primarily used internally by the toJson methods to structure integration log data.
Last updated