Interface EventLogger

All Known Implementing Classes:
DefaultEventLogger, SdkEventLoggerProvider.SdkEventLogger

@ThreadSafe public interface EventLogger
A EventLogger is the entry point into an event pipeline.

Example usage emitting events:


 class MyClass {
   private final EventLogger eventLogger = eventLoggerProvider
         .eventLoggerBuilder("scope-name")
         .build();

   void doWork() {
     eventLogger.builder("my-namespace.my-event")
         .put("key1", "value1")
         .put("key2", "value2")
         .emit();
     // do work
   }
 }
 
  • Method Details

    • builder

      EventBuilder builder(String eventName)
      Return a EventBuilder to emit an event.
      Parameters:
      eventName - the event name, which identifies the class or type of event. Event with the same name are structurally similar to one another. Event names are subject to the same naming rules as attribute names. Notably, they are namespaced to avoid collisions. See event.name semantic conventions for more details.