TelemetryLoggerMiddleware Class
- java.
lang. Object - com.
microsoft. bot. builder. TelemetryLoggerMiddleware
- com.
Implements
public class TelemetryLoggerMiddleware
implements Middleware
Middleware for logging incoming, outgoing, updated or deleted Activity messages. Uses the BotTelemetryClient interface.
Constructor Summary
| Constructor | Description |
|---|---|
| TelemetryLoggerMiddleware(BotTelemetryClient withTelemetryClient, boolean withLogPersonalInformation) |
Initializes a new instance of the class. |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
| protected java.util.concurrent.CompletableFuture<java.util.Map<java.lang.String,java.lang.String>> |
fillDeleteEventProperties(Activity activity, Map<String,String> additionalProperties)
Fills the event properties for Bot |
| protected java.util.concurrent.CompletableFuture<java.util.Map<java.lang.String,java.lang.String>> |
fillReceiveEventProperties(Activity activity, Map<String,String> additionalProperties)
Fills the event properties for the Bot |
| protected java.util.concurrent.CompletableFuture<java.util.Map<java.lang.String,java.lang.String>> |
fillSendEventProperties(Activity activity, Map<String,String> additionalProperties)
Fills the event properties for Bot |
| protected java.util.concurrent.CompletableFuture<java.util.Map<java.lang.String,java.lang.String>> |
fillUpdateEventProperties(Activity activity, Map<String,String> additionalProperties)
Fills the event properties for Bot |
|
Bot |
getTelemetryClient()
Gets the currently configured Bot |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onDeleteActivity(Activity activity)
Invoked when the bot deletes a message. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onReceiveActivity(Activity activity)
Invoked when a message is received from the user. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onSendActivity(Activity activity)
Invoked when the bot sends a message to the user. |
| java.util.concurrent.CompletableFuture<java.lang.Void> |
onTurn(TurnContext context, NextDelegate next)
Logs events based on incoming and outgoing activities using the BotTelemetryClient interface. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onUpdateActivity(Activity activity)
Invoked when the bot updates a message. |
Methods inherited from java.lang.Object
Constructor Details
TelemetryLoggerMiddleware
public TelemetryLoggerMiddleware(BotTelemetryClient withTelemetryClient, boolean withLogPersonalInformation)
Initializes a new instance of the class.
Parameters:
Method Details
fillDeleteEventProperties
protected CompletableFuture
Fills the event properties for BotMessageDelete. These properties are logged when an activity message is sent by the Bot to the user.
Parameters:
Returns:
fillReceiveEventProperties
protected CompletableFuture
Fills the event properties for the BotMessageReceived. Adheres to the LogPersonalInformation flag to filter Name, Text and Speak properties.
Parameters:
Returns:
fillSendEventProperties
protected CompletableFuture
Fills the event properties for BotMessageSend. These properties are logged when an activity message is sent by the Bot to the user.
Parameters:
Returns:
fillUpdateEventProperties
protected CompletableFuture
Fills the event properties for BotMessageUpdate. These properties are logged when an activity message is sent by the Bot to the user.
Parameters:
Returns:
getTelemetryClient
public BotTelemetryClient getTelemetryClient()
Gets the currently configured BotTelemetryClient that logs the event.
Returns:
onDeleteActivity
protected CompletableFuture
Invoked when the bot deletes a message. Performs logging of telemetry data using the BotTelemetryClient#trackEvent method. This event name used is "BotMessageDelete".
Parameters:
Returns:
onReceiveActivity
protected CompletableFuture
Invoked when a message is received from the user. Performs logging of telemetry data using the BotTelemetryClient#trackEvent method. This event name used is "BotMessageReceived".
Parameters:
Returns:
onSendActivity
protected CompletableFuture
Invoked when the bot sends a message to the user. Performs logging of telemetry data using the BotTelemetryClient#trackEvent method. This event name used is "BotMessageSend".
Parameters:
Returns:
onTurn
public CompletableFuture
Logs events based on incoming and outgoing activities using the BotTelemetryClient interface.
Parameters:
Returns:
onUpdateActivity
protected CompletableFuture
Invoked when the bot updates a message. Performs logging of telemetry data using the BotTelemetryClient#trackEvent method. This event name used is "BotMessageUpdate".
Parameters:
Returns: