botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

Filtering/Logging bot messages

Open davidbabicka opened this issue 10 years ago • 7 comments

Sorry if this was already available but couldn't find yet. How can I filter or log the bot messages (node.js) ? Is there a sample project?

davidbabicka avatar Mar 31 '16 17:03 davidbabicka

You can use a piece of middleware to do that. I'll add a logging sample for you. It will currently only log incoming messages but I'm planning changes to middleware that will allow both incoming and outgoing hooks

Stevenic avatar Mar 31 '16 21:03 Stevenic

I added a new logging example you can checkout. It also shows how to intercept user sent /commands to turn features on & off.

Stevenic avatar Mar 31 '16 23:03 Stevenic

@Stevenic Is there also a sample for how to log all outgoing messages in c#?

berhir avatar Jul 07 '16 18:07 berhir

+shahin

Stevenic avatar Jul 12 '16 02:07 Stevenic

@msft-shahins @Stevenic any updates on c# logging?

jcmontx avatar Nov 23 '16 13:11 jcmontx

@jcmontes95 you can implement an IActivityLogger and register it with the conversation container. By default builder registers the (NullActivityLogger)[https://github.com/Microsoft/BotBuilder/blob/master/CSharp/Library/Dialogs/IActivityLogger.cs#L81] with the container which is a no-op.

Here is a sample implementation of IActivityLogger using Azure table storage: https://github.com/Microsoft/BotBuilder/blob/master/CSharp/Library/Microsoft.Bot.Builder.Azure/TableLogger.cs#L60.

msft-shahins avatar Nov 23 '16 18:11 msft-shahins

@msft-shahins thank you!

jcmontx avatar Nov 24 '16 14:11 jcmontx