TelemetryLoggerMiddleware class

Middleware for logging incoming, outgoing, updated or deleted Activity messages. Uses the botTelemetryClient interface.

Constructors

TelemetryLoggerMiddleware(BotTelemetryClient, boolean)

Initializes a new instance of the TelemetryLoggerMiddleware class.

Properties

botMsgDeleteEvent

The name of the event when a message is deleted by the bot.

botMsgReceiveEvent

The name of the event when when new message is received from the user.

botMsgSendEvent

The name of the event when a message is updated by the bot.

botMsgUpdateEvent

The name of the event when a message is updated by the bot.

logPersonalInformation

Gets a value indicating whether to log personal information that came from the user.

telemetryClient

Gets the currently configured botTelemetryClient that logs the events.

Methods

onTurn(TurnContext, () => Promise<void>)

Logs events based on incoming and outgoing activities using the botTelemetryClient class.

Constructor Details

TelemetryLoggerMiddleware(BotTelemetryClient, boolean)

Initializes a new instance of the TelemetryLoggerMiddleware class.

new TelemetryLoggerMiddleware(telemetryClient: BotTelemetryClient, logPersonalInformation?: boolean)

Parameters

telemetryClient
BotTelemetryClient

The BotTelemetryClient used for logging.

logPersonalInformation

boolean

(Optional) Enable/Disable logging original message name within Application Insights.

Property Details

botMsgDeleteEvent

The name of the event when a message is deleted by the bot.

static botMsgDeleteEvent: string

Property Value

string

botMsgReceiveEvent

The name of the event when when new message is received from the user.

static botMsgReceiveEvent: string

Property Value

string

botMsgSendEvent

The name of the event when a message is updated by the bot.

static botMsgSendEvent: string

Property Value

string

botMsgUpdateEvent

The name of the event when a message is updated by the bot.

static botMsgUpdateEvent: string

Property Value

string

logPersonalInformation

Gets a value indicating whether to log personal information that came from the user.

boolean logPersonalInformation

Property Value

boolean

A value indicating whether to log personal information or not.

telemetryClient

Gets the currently configured botTelemetryClient that logs the events.

BotTelemetryClient telemetryClient

Property Value

The currently configured BotTelemetryClient that logs the events.

Method Details

onTurn(TurnContext, () => Promise<void>)

Logs events based on incoming and outgoing activities using the botTelemetryClient class.

function onTurn(context: TurnContext, next: () => Promise<void>): Promise<void>

Parameters

context
TurnContext

The context object for this turn.

next

() => Promise<void>

The delegate to call to continue the bot middleware pipeline

Returns

Promise<void>