登录Microsoft Azure TableController

时间:2017-04-24 03:04:44

标签: c# azure logging mobile service

有人可以告诉我如何从TableController类(Microsoft.Azure.Mobile.Server)进行日志记录吗?我已经看到一些地方(例如https://blogs.msdn.microsoft.com/azuremobile/2014/04/24/logging-with-the-net-backend-for-azure-mobile-services/)向用户说明TableController服务成员,Log属性并从那里调用日志记录方法--this.Services.Log.Info(“log text”)。但我没有看到TableController类的任何Services成员。

谢谢, 史蒂夫

1 个答案:

答案 0 :(得分:0)

“服务”属性仅适用于Azure移动服务。在Azure移动应用程序中,“服务”属性不再是SDK的一部分。现在使用标准的ASP.NET跟踪编写完成日志记录。

ITraceWriter traceWriter = this.Configuration.Services.GetTraceWriter();
traceWriter.Info("Hello, World");  

有关详细信息,请参阅以下链接供您参考。

Upgrade your existing .NET Azure Mobile Service to App Service