Interface ExchangeFormatter


public interface ExchangeFormatter
Strategy for rendering an Exchange as a human-readable String, used primarily for logging and tracing output.

Camel's built-in logging processor, the BacklogTracer, and the log component all delegate to an ExchangeFormatter to produce the text that appears in log lines. The default implementation (DefaultExchangeFormatter in camel-support) provides options to include/exclude headers, body content, and exchange properties, as well as to truncate large payloads. Callers can register a custom ExchangeFormatter bean in the registry to override the default rendering globally.

Implementations must be thread-safe: a single instance is typically shared across all threads that process exchanges on a route.

  • Method Summary

    Modifier and Type
    Method
    Description
    format(Exchange exchange)
    Generates a string representation of the exchange
  • Method Details

    • format

      String format(Exchange exchange)
      Generates a string representation of the exchange
      Parameters:
      exchange - the exchange
      Returns:
      a string representation of the exchange