v4.12.9 - Added RestRequest and RestResponse Logging #622
jongpie
announced in
Announcements
Replies: 1 comment 1 reply
-
@jongpie How can we use the new methods setRestRequestDetails. I can't see any traces of it in logger? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Thanks to @diegocomi for suggesting this enhancement!
Core Unlocked Package Changes
Added logging support for instances of
RestRequest
andRestResponse
Resolved Ability to Log against RestRequest/RestResponse #514 (suggested by @diegocomi) in PR Added logging support for instances of RestRequest and RestResponse #613 by introducing new features & fields to support logging instances of
System.RestRequest
andSystem.RestResponse
that are used for Apex REST services:Added 2 new
global
instance methods inLogEntryBuilder
to provide a way to log instances ofSystem.RestRequest
andSystem.RestResponse
:global LogEntryEventBuilder setRestRequestDetails(System.RestRequest request);
global LogEntryEventBuilder setRestResponseDetails(System.RestResponse response);
Added 2 new
LoggerParameter__mdt
records to control logging of request & response headers when using the new builder methods. TheseLoggerParameter__mdt
records are equivalent to the recordStoreHttpResponseHeaderValues
(introduced in Nebula Loggerv4.11.8
) forSystem.HttpResponse
logging:StoreRestRequestHeaderValues
- this metadata records controls if the request's header values are stored in new fieldsLogEntryEvent__e.RestRequestHeaders__c
andLogEntryEvent__e.RestrequestHeaders__c
. By default, it's enabled.StoreRestResponseHeaderValues
- this metadata records controls if the response's header values are stored in new fieldsLogEntryEvent__e.RestResponseHeaders__c
andLogEntryEvent__e.RestResponseHeaders__c
. By default, it's enabled.Added 9 new fields for
System.RestRequest
data onLogEntryEvent__e
platform eventLogEntryEvent__e.RestRequestBodyMasked__c
LogEntryEvent__e.RestRequestBody__c
LogEntryEvent__e.RestRequestHeaderKeys__c
LogEntryEvent__e.RestRequestHeaders__c
LogEntryEvent__e.RestRequestMethod__c
LogEntryEvent__e.RestRequestParameters__c
LogEntryEvent__e.RestRequestRemoteAddress__c
LogEntryEvent__e.RestRequestResourcePath__c
LogEntryEvent__e.RestRequestUri__c
Added 5 new fields for
System.RestResponse
data onLogEntryEvent__e
platform eventLogEntryEvent__e.RestResponseBodyMasked__c
LogEntryEvent__e.RestResponseBody__c
LogEntryEvent__e.RestResponseHeaderKeys__c
LogEntryEvent__e.RestResponseHeaders__c
LogEntryEvent__e.RestResponseStatusCode__c
Added 12 new fields for
System.RestResponse
data onLogEntry__c
custom objectLogEntry__c.HasRestRequestBody__c
LogEntry__c.HasRestRequestHeaderKeys__c
LogEntry__c.HasRestRequestHeaders__c
LogEntry__c.RestRequestBody__c
LogEntry__c.RestRequestBodyMasked__c
LogEntry__c.RestRequestHeaderKeys__c
LogEntry__c.RestRequestHeaders__c
LogEntry__c.RestRequestMethod__c
LogEntry__c.RestRequestParameters__c
LogEntry__c.RestRequestRemoteAddress__c
LogEntry__c.RestRequestResourcePath__c
LogEntry__c.RestRequestUri__c
Added 8 new fields for
System.RestResponse
data onLogEntry__c
custom objectLogEntry__c.HasRestResponseBody__c
LogEntry__c.HasRestResponseHeaderKeys__c
LogEntry__c.HasRestResponseHeaders__c
LogEntry__c.RestResponseBodyMasked__c
LogEntry__c.RestResponseBody__c
LogEntry__c.RestResponseHeaderKeys__c
LogEntry__c.RestResponseHeaders__c
LogEntry__c.RestResponseStatusCode__c
Updated permission sets
LoggerAdmin
,LoggerLogViewer
, andLoggerEndUser
to add access to the new custom fields onLogEntry__c
Add 2 new sections on
LogEntryRecordPage
flexipage (shown in the screenshot below)Apex REST Service Request
section shows the corresponding fields forRestRequest
data (when populated)Apex REST Service Response
section shows the corresponding fields forRestResponse
data (when populated)Renamed 2 existing sections on
LogEntryRecordPage
flexipage to help avoid confusion with the 2 new sectionsApex Rest Service Request
andApex REST Service Response
HTTP Request
is nowHTTP Callout Request
HTTP Response
is nowHTTP Callout Response
Reduced the Max Length of Several Existing Long Textarea Fields
As Nebula Logger's data model continues to grow, the per-object limit for long textarea fields becomes increasingly important to consider. To compensate for this limit, and to better reflect the amount of data typically stored in these fields, several older fields have been updated to reduce their max length:
LogEntryEvent__e.ExceptionMessage__c
: 131,072 limit reduced to 5,000LogEntryEvent__e.ExceptionStackTrace__c
: 131,072 limit reduced to 5,000LogEntryEvent__e.StackTrace__c
: 131,072 limit reduced to 5,000LogEntryEvent__e.Topics__c
(deprecated/no longer used): 131,072 limit reduced to 256LogEntry__c.ExceptionMessage__c
: 131,072 limit reduced to 5,000LogEntry__c.ExceptionStackTrace__c
: 131,072 limit reduced to 5,000LogEntry__c.FlowDescription__c
: 131,072 limit reduced to 5,000LogEntry__c.StackTrace__c
: 131,072 limit reduced to 5,000Installation Info
Core Unlocked Package - no namespace
Full Changelog: v4.12.8...v4.12.9
sf package install --wait 20 --security-type AdminsOnly --package 04t5Y000001Mk7BQAS
sfdx force:package:install --wait 20 --securitytype AdminsOnly --package 04t5Y000001Mk7BQAS
This discussion was created from the release Added RestRequest and RestResponse Logging.
Beta Was this translation helpful? Give feedback.
All reactions