It's my first contribution to a public repo ever, so I hope I get this right. Happy to submit a PR for this if it's a welcome addition — wanted to check first per CONTRIBUTING.md.
I use the Callable interface for an internal project to allow logging from our custom exceptions and running into an issue where I cannot pass in HttpRequest/HttpResponse objects for logging.
LogEntryEventBuilder.setHttpRequestDetails() / setHttpResponseDetails() (added per #240) let Apex code logging via the direct Logger.newEntry(...) fluent API populate the HttpRequest*__c/HttpResponse*__c fields on LogEntryEvent__e/LogEntry__c.
But CallableLogger's newEntry action — the supported way for ISV/subscriber packages to integrate with Nebula Logger without a compile-time dependency on the Nebula namespace (per the Dynamically Call Nebula Logger wiki) — only recognizes exception, recordId/record/recordList/recordMap, tags, parentLogTransactionId, and saveLog as input arguments. There's no way to pass an HttpRequest/HttpResponse through the Callable bridge, so packages using it for loose coupling can't get HTTP-aware log entries at all today.
Proposed fix: add two new optional input keys to the newEntry action — httpRequest (System.HttpRequest, optionally paired with httpRequestHeadersToLog as List<String> to match the existing setHttpRequestDetails overload) and httpResponse (System.HttpResponse) — and call the existing setHttpRequestDetails()/setHttpResponseDetails() builder methods when present, following the same containsKey-guarded pattern already used for exception/record. No schema changes needed (the target fields already exist).
It's my first contribution to a public repo ever, so I hope I get this right. Happy to submit a PR for this if it's a welcome addition — wanted to check first per
CONTRIBUTING.md.I use the Callable interface for an internal project to allow logging from our custom exceptions and running into an issue where I cannot pass in
HttpRequest/HttpResponseobjects for logging.LogEntryEventBuilder.setHttpRequestDetails()/setHttpResponseDetails()(added per #240) let Apex code logging via the directLogger.newEntry(...)fluent API populate theHttpRequest*__c/HttpResponse*__cfields onLogEntryEvent__e/LogEntry__c.But
CallableLogger'snewEntryaction — the supported way for ISV/subscriber packages to integrate with Nebula Logger without a compile-time dependency on the Nebula namespace (per the Dynamically Call Nebula Logger wiki) — only recognizes exception, recordId/record/recordList/recordMap, tags, parentLogTransactionId, and saveLog as input arguments. There's no way to pass an HttpRequest/HttpResponse through the Callable bridge, so packages using it for loose coupling can't get HTTP-aware log entries at all today.Proposed fix: add two new optional input keys to the
newEntryaction —httpRequest(System.HttpRequest, optionally paired withhttpRequestHeadersToLogasList<String>to match the existingsetHttpRequestDetailsoverload) andhttpResponse(System.HttpResponse) — and call the existingsetHttpRequestDetails()/setHttpResponseDetails()builder methods when present, following the samecontainsKey-guarded pattern already used for exception/record. No schema changes needed (the target fields already exist).