Skip to content

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

  1. Construct LoggingServiceProxy(serviceUrl): guard serviceUrl (WP-BR-001), then build a default BasicHttpBinding client.
  2. LogException(detail): map ApplicationExceptionDetail to ErrorInfoStruct via Extensions.ToErrorInfoStruct:
  3. Application → ApplicationName
  4. Environment → Environment
  5. ExceptionDate → ErrorDate
  6. Message → ExceptionInfo
  7. Source → ExceptionSource
  8. Machine → MachineName
  9. Page → PageName
  10. State → StateInfo
  11. User → Username
  12. ExtensionData is set to null
  13. 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 serviceUrl at construction throws an argument exception before any wire client is created.
  • The mapping is a direct field copy with no validation; a malformed detail is forwarded as-is to the remote service*.

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