Skip to content

Add HttpRequest/HttpResponse support to CallableLogger's newEntry action - #1024

Open
simonfcodes wants to merge 1 commit into
jongpie:mainfrom
simonfcodes:feature/callable-logger-http-details
Open

Add HttpRequest/HttpResponse support to CallableLogger's newEntry action#1024
simonfcodes wants to merge 1 commit into
jongpie:mainfrom
simonfcodes:feature/callable-logger-http-details

Conversation

@simonfcodes

Copy link
Copy Markdown

Closes #1023.

What

CallableLogger's newEntry action only recognized exception, recordId/record/recordList/recordMap, tags, parentLogTransactionId, and saveLog as input keys. There was no way to pass an HttpRequest/HttpResponse through the Callable bridge, even though LogEntryEventBuilder already exposes setHttpRequestDetails()/setHttpResponseDetails() for the direct fluent API (added per #240). That meant packages using the Callable interface for loose coupling (per the Dynamically Call Nebula Logger wiki) couldn't get HTTP-aware log entries at all.

Change

Two new optional input keys on the newEntry action, following the same containsKey-guarded pattern already used for exception/record/tags:

  • httpRequest (System.HttpRequest), optionally paired with httpRequestHeadersToLog (List<String>) to match the existing setHttpRequestDetails() overload
  • httpResponse (System.HttpResponse)

No schema changes - the target HttpRequest*__c/HttpResponse*__c fields already exist on LogEntryEvent__e/LogEntry__c, they just weren't reachable through this bridge.

Testing

Added 2 new tests to CallableLogger_Tests.cls (HttpRequest with headers-to-log, and HttpResponse), following the existing test conventions in that file. Ran prettier and the repo's PMD rule set (pmd:(1,2,3)) against both changed files locally - clean on both.

This is a starting proposal on the exact input-key shape - happy to adjust the design if a different approach (e.g. a DTO) is preferred.

CallableLogger's newEntry action only recognized exception, recordId/
record/recordList/recordMap, tags, parentLogTransactionId, and saveLog
as input keys - there was no way to pass an HttpRequest/HttpResponse
through the Callable bridge, even though LogEntryEventBuilder already
exposes setHttpRequestDetails()/setHttpResponseDetails() for the direct
fluent API.

Adds two new optional input keys, following the same containsKey-guarded
pattern already used for exception/record:
- httpRequest (System.HttpRequest), optionally paired with
  httpRequestHeadersToLog (List<String>) to match the existing
  setHttpRequestDetails() overload
- httpResponse (System.HttpResponse)

No schema changes needed - the target fields already exist on
LogEntryEvent__e/LogEntry__c.

Fixes jongpie#1023
@simonfcodes
simonfcodes requested a review from jongpie as a code owner August 29, 2026 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CallableLogger newEntry doesn't suppose HttpRequest/HttpResponse

1 participant