v4.14.8 - Added the ability to capture HttpRequest headers #757
jongpie
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Resolved #701 by providing a way to indicate which
HttpRequest
headers (and values) should be logged - previously, no header information was stored forHttpRequest
objects.Conceptually, this is the same idea as logging headers when calling the other
LogEntryBuilder
methods below:setHttpResponseDetails(System.HttpResponse response)
setRestRequestDetails(System.RestRequest request)
setRestResponseDetails(System.RestResponse response)
However, there is one notable difference in the new behavior for logging
HttpRequest
headers - theHttpRequest
class does not have a method to get all of the header keys, so you must explicitly tell Nebula Logger which header keys you want to log.Core Unlocked Package Changes
LogEntryEventBuilder.setHttpRequestDetails(System.HttpRequest request, List<String> headersToLog)
headersToLog
will now be loggedsetHttpRequestDetails(System.HttpRequest request)
, will not log any header informationLogEntryEvent__e
fieldsHttpRequestHeaderKeys__c
andHttpRequestHeaders__c
to capture the specified list of header keysHttpResponse
header data stored inHttpResponseHeaderKeys__c
andHttpResponseHeaders__c
RestRequest
header data stored inRestRequestHeaderKeys__c
andRestRequestHeaders__c
RestResponse
header data stored inRestResponseHeaderKeys__c
andRestRequestHeaders__c
LoggerParameter__mdt
recordStoreHttpRequestHeaderValues
to globally control ifHttpResponse
header values are stored when callingsetHttpRequestDetails(System.HttpRequest request, List<String> headersToLog)
StoreHttpResponseHeaderValues
(used for responses)LogEntry__c
fields to store theHttpRequest
header keys & values captured onLogEntryEvent__e
, as well as some checkbox fields to aid with filtering in SOQL, list views, etc.HttpRequestHeaderKeys__c
HasHttpRequestHeaderKeys__c
- set totrue
whenHttpRequestHeaderKeys__c
is not nullHttpRequestHeaders__c
HasHttpRequestHeaders__c
- set totrue
whenHttpRequestHeaders__c
is not nullLogEntryRecordPage
to add the 2 newLogEntry__c
fieldsHttpRequestHeaderKeys__c
andHttpRequestHeaders__c
HasHttpRequestHeaderKeys__c
andHasHttpRequestHeaders__c
(respectively)AllHttpRequestLogEntries
to include the new fieldHttpRequestHeaderKeys__c
(HttpRequestHeader__c
is intentionally not included at this time)Example
This example Apex script will create a
LogEntry__c
record with data about theHttpRequest
- including the 2 specified header keys & their values.Pipeline Changes
build.yml
to fail the build if the codecov upload action failsInstallation Info
Core Unlocked Package - no namespace
Full Changelog: v4.14.7...v4.14.8
sf package install --wait 20 --security-type AdminsOnly --package 04t5Y0000015oS1QAI
sfdx force:package:install --wait 20 --securitytype AdminsOnly --package 04t5Y0000015oS1QAI
This discussion was created from the release Added the ability to capture HttpRequest headers.
Beta Was this translation helpful? Give feedback.
All reactions