You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks so much to @TrangOul for suggesting this enhancement, providing Apex code snippets for the implementation, and helping with code review!
Core Unlocked Package Changes
New Feature: Store HttpResponse Header Values
Resolved Log headers from HttpResponse (and possibly HttpRequest) objects #561 (reported by @TrangOul) by adding new fields LogEntryEvent__e.HttpResponseHeaders__c and LogEntry__c.HttpResponseHeaders__c that store the full key-value pair for each header set on the logged instance of System.HttpResponse. These fields are now automatically set when using the instance method LogEntryEventBuilder.setHttpResponseDetails(System.HttpResponse).
Based on the great suggestion from @TrangOul, each header key-value pair is stored in the format Header: value to match the (HTTP standard). A \n line break is used as a delimiter between each header when there are multiple headers.
For orgs that do not want to store the header values (either due to security concerns with storing this information, or other concerns), you can disable this functionality org-wide by updating the new LoggerParameter__mdt record StoreHttpResponseHeaderValues to false. By default, this feature is enabled/set to true
The existing fields LogEntryEvent__e.HttpResponseHeaderKeys__c and LogEntry__c.HttpResponseHeaderKeys__c will continue to be populated. These fields store only the header keys, not the header values, and some orgs have existing tests & logic that rely on checking the logged keys. These fields are always populated for instances of System.HttpResponse, regardless of the configuration of the new LoggerParameter__mdt record StoreHttpResponseHeaderValues.
Updated permission sets LoggerAdmin and LoggerLogViewer to have read access to the new field LogEntry__c.HttpResponseHeaders__c.
The permission set LoggerEndUser intentionally does not have access to this field (or any other fields related to HttpResponse or HttpRequest).
Added new field LogEntry__c.HttpResponseHeaders__c to the FlexiPage LogEntryRecordPage. This field is shown in addition to the existing field LogEntry__c.HttpResponseHeaderKeys__c, shown in the (massive 😅) screenshot below
Updated Internal Coding Conventions for Apex if Statements
Updated ~300 if statements throughout the codebase to simplify checking Booleans from if(condition == true) to just if(condition). A few existing Booleans were also updated to have a default value to avoid issues with null values.
This (hopefully) shouldn't impact any functionality in Nebula Logger - the goal of this change is purely to update the coding style used within the codebase to be a bit more concise, based on some feedback received over the last year or so, including a discussion last year with @rmccu in explicit check for true? #383 and PR comment from @TrangOul.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Thanks so much to @TrangOul for suggesting this enhancement, providing Apex code snippets for the implementation, and helping with code review!
Core Unlocked Package Changes
New Feature: Store
HttpResponse
Header ValuesResolved Log headers from HttpResponse (and possibly HttpRequest) objects #561 (reported by @TrangOul) by adding new fields
LogEntryEvent__e.HttpResponseHeaders__c
andLogEntry__c.HttpResponseHeaders__c
that store the full key-value pair for each header set on the logged instance ofSystem.HttpResponse
. These fields are now automatically set when using the instance methodLogEntryEventBuilder.setHttpResponseDetails(System.HttpResponse)
.Header: value
to match the (HTTP standard). A\n
line break is used as a delimiter between each header when there are multiple headers.LoggerParameter__mdt
recordStoreHttpResponseHeaderValues
tofalse
. By default, this feature is enabled/set totrue
LogEntryEvent__e.HttpResponseHeaderKeys__c
andLogEntry__c.HttpResponseHeaderKeys__c
will continue to be populated. These fields store only the header keys, not the header values, and some orgs have existing tests & logic that rely on checking the logged keys. These fields are always populated for instances ofSystem.HttpResponse
, regardless of the configuration of the newLoggerParameter__mdt
recordStoreHttpResponseHeaderValues
.Updated permission sets
LoggerAdmin
andLoggerLogViewer
to haveread
access to the new fieldLogEntry__c.HttpResponseHeaders__c
.LoggerEndUser
intentionally does not have access to this field (or any other fields related toHttpResponse
orHttpRequest
).Added new field
LogEntry__c.HttpResponseHeaders__c
to the FlexiPageLogEntryRecordPage
. This field is shown in addition to the existing fieldLogEntry__c.HttpResponseHeaderKeys__c
, shown in the (massive 😅) screenshot belowUpdated Internal Coding Conventions for Apex
if
Statementsif
statements throughout the codebase to simplify checking Booleans fromif(condition == true)
to justif(condition)
. A few existing Booleans were also updated to have a default value to avoid issues withnull
values.Installation Info
Core Unlocked Package - no namespace
Full Changelog: v4.11.7...v4.11.8
sf package install --wait 20 --security-type AdminsOnly --package 04t5Y000001Oig9QAC
sfdx force:package:install --wait 20 --securitytype AdminsOnly --package 04t5Y000001Oig9QAC
This discussion was created from the release Store HttpResponse header values .
Beta Was this translation helpful? Give feedback.
All reactions