DocuSign.Debug (DocuSign v3.1.1)
View SourceDebugging and logging configuration for the DocuSign Elixir client.
This module provides functionality to configure debug logging for HTTP requests and responses, similar to the Ruby DocuSign client's debugging capabilities.
Configuration
Enable debugging by setting the :debug option in your application config:
config :docusign, debug: trueYou can also configure logging at runtime:
DocuSign.Debug.enable_debugging()
DocuSign.Debug.disable_debugging()Debug Logging
When debugging is enabled, the client will log:
- HTTP request method, URL, and headers
- HTTP request body (with sensitive data filtered)
- HTTP response status, headers, and body
- Request/response timing information
Header Filtering
Sensitive headers like authorization tokens are automatically filtered in debug logs:
config :docusign, :debug_filter_headers, ["authorization", "x-api-key"]Examples
# Enable debugging for development
config :docusign, debug: true
# Configure debug settings
config :docusign,
debug: true,
debug_filter_headers: ["authorization", "x-custom-secret"]
# Or enable at runtime
DocuSign.Debug.enable_debugging()
Summary
Functions
Get all middleware for DocuSign connections including debugging and SDK headers.
Check if debugging is currently enabled.
Disable debugging for DocuSign HTTP requests.
Enable debugging for DocuSign HTTP requests.
Get the list of headers to filter in debug logs.
Build middleware for debugging based on current configuration.
Get SDK headers for identifying the Elixir client.
Functions
@spec all_middleware() :: list()
Get all middleware for DocuSign connections including debugging and SDK headers.
Note: This function is now deprecated as Req handles middleware differently. Use sdk_headers() directly if needed.
@spec debugging_enabled?() :: boolean()
Check if debugging is currently enabled.
@spec disable_debugging() :: :ok
Disable debugging for DocuSign HTTP requests.
@spec enable_debugging() :: :ok
Enable debugging for DocuSign HTTP requests.
This will enable debug logging for all DocuSign connections.
@spec filter_headers() :: [String.t()]
Get the list of headers to filter in debug logs.
Returns the configured filter headers or defaults to ["authorization"].
@spec middleware() :: list()
Build middleware for debugging based on current configuration.
Note: This function is now deprecated as Req handles middleware differently.
Get SDK headers for identifying the Elixir client.
This adds the X-DocuSign-SDK header to identify the Elixir client, matching the Ruby client's behavior.