Class LoggerTelemetryPublisher

java.lang.Object
com.azure.spring.cloud.feature.management.telemetry.LoggerTelemetryPublisher
All Implemented Interfaces:
TelemetryPublisher

public class LoggerTelemetryPublisher extends Object implements TelemetryPublisher
Telemetry publisher that logs feature evaluation events using SLF4J. This class implements the TelemetryPublisher interface and is responsible for publishing telemetry events related to feature evaluations. It uses SLF4J for logging the events, which allows for easy integration with various logging frameworks. It uses MDC (Mapped Diagnostic Context) to add contextual information to the logs, such as feature name, enabled status, variant name, and reason for the evaluation.
  • Constructor Details

    • LoggerTelemetryPublisher

      public LoggerTelemetryPublisher()
      Constructor for LoggerTelemetryPublisher.
  • Method Details

    • publish

      public void publish(EvaluationEvent evaluationEvent)
      Publishes telemetry events related to feature evaluations. It logs the evaluation event using SLF4J, adding contextual information to the logs using MDC.
      Specified by:
      publish in interface TelemetryPublisher
      Parameters:
      evaluationEvent - The evaluation event to be published.