2017-04-24 111 views
0

有人能告诉我如何从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类的任何服务成员。登录Microsoft Azure TableController

谢谢你,史蒂夫

回答

0

Services属性只能在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