Log an exception remotely¶
LoggingServiceProxy.LogException wraps the Logging SOAP service (clsWSLoggingSoapClient) to forward an ApplicationExceptionDetail to the centralized logging service, mapping each field to the wire ErrorInfoStruct.
| Field | Value |
|---|---|
| Operation ID | OP-WP-04 |
| Trigger | EnvironmentApi's SAIFExceptionLogger (non-eligible in this run), or package consumers |
| Inputs | SAIF.Core.Contracts.ApplicationExceptionDetail |
| Outputs | A remote WriteError call; no return value |
| Primary components | LoggingServiceProxy.LogException, Extensions.ToErrorInfoStruct |
| Entry point | Services/SAIF.Services.Web.Proxies/LoggingServiceProxy.cs |
Steps¶
- Construct
LoggingServiceProxy(serviceUrl): guardserviceUrl(WP-BR-001), then build a defaultBasicHttpBindingclient. LogException(detail): mapApplicationExceptionDetailtoErrorInfoStructviaExtensions.ToErrorInfoStruct:Application→ApplicationNameEnvironment→EnvironmentExceptionDate→ErrorDateMessage→ExceptionInfoSource→ExceptionSourceMachine→MachineNamePage→PageNameState→StateInfoUser→UsernameExtensionDatais set to null- Call wire
WriteError(eis).
Process flow¶
The following diagram visualizes the field mapping and delegation to the wire operation.
flowchart TD
Start([LogException invoked]) --> Map["Map ApplicationExceptionDetail<br>to ErrorInfoStruct"]
Map --> Call["Call wire WriteError(eis)"]
Call --> Ret(["Return; no result"])
Failure and edge-case behavior¶
- A null/empty
serviceUrlat construction throws an argument exception before any wire client is created. - The mapping is a direct field copy with no validation; a malformed
detailis forwarded as-is to the remote service*.
Related documentation¶
Note: Statements marked with
*were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts.
Sources¶
Services/SAIF.Services.Web.Proxies/LoggingServiceProxy.cs