DocuSign.Debug (DocuSign v3.1.1)

View Source

Debugging 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: true

You 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

all_middleware() deprecated

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.

middleware() deprecated

Build middleware for debugging based on current configuration.

Get SDK headers for identifying the Elixir client.

Functions

all_middleware()

This function is deprecated. Use sdk_headers() directly with Req configuration.
@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.

debugging_enabled?()

@spec debugging_enabled?() :: boolean()

Check if debugging is currently enabled.

disable_debugging()

@spec disable_debugging() :: :ok

Disable debugging for DocuSign HTTP requests.

enable_debugging()

@spec enable_debugging() :: :ok

Enable debugging for DocuSign HTTP requests.

This will enable debug logging for all DocuSign connections.

filter_headers()

@spec filter_headers() :: [String.t()]

Get the list of headers to filter in debug logs.

Returns the configured filter headers or defaults to ["authorization"].

middleware()

This function is deprecated. Use sdk_headers() directly with Req configuration.
@spec middleware() :: list()

Build middleware for debugging based on current configuration.

Note: This function is now deprecated as Req handles middleware differently.

sdk_headers()

@spec sdk_headers() :: [{String.t(), String.t()}]

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.