Using the Bot Framework SDK for .NET, you can provide implementations of the IPostToBot and IBotToUser interfaces to the Autofac dependency injection container. Using the Bot Framework SDK for any language, you can use middleware for much the same purpose. The BotBuilder-Azure repository contains C# and Node.js libraries that will log this data to an Azure table.