【问题标题】:Semantic logging (SLAB) for MVC Azure WebappMVC Azure Webapp 的语义日志记录 (SLAB)
【发布时间】:2015-09-08 00:26:10
【问题描述】:

我正在尝试为我的 Azure Web 应用程序(进行中)实现 SLAB,我的列表器是 Azure 表存储(表连接字符串), 我面临的问题是 -“EventSource.IsEnabled() = 总是返回 false” (我正在使用 IIS express 从 VS2013 运行应用程序)

我的代码

————global.asax

var listener2 = new ObservableEventListener();
listener2.EnableEvents(SBEvents.Log, EventLevel.Verbose,Keywords.All);
listener2.LogToWindowsAzureTable(“sdf”, “DefaultEndpointsProtocol=https;AccountName=********;AccountKey=****************);

——-事件源

Public class SBEvents :EventSource {
public class keywords{...}
public class Tasks {..}

private static readonly Lazy Instance = new Lazy(() => new SBEvents());
public static SBEvents Log { get { return Instance.Value; } }

[Event(102, Message = “Bike started with Bike ID :{0}”, Keywords =    Keywords.Application, Level = EventLevel.Informational)]
public void BikeStarted(String BikeID){
if (this.IsEnabled()) //// = always returns false
this.WriteEvent(102,BikeID);

【问题讨论】:

    标签: azure web-applications slab


    【解决方案1】:

    看起来“Azure Web Apps”无法监听 ETW 事件。

    https://azure.microsoft.com/en-in/documentation/articles/choose-web-site-cloud-service-vm/

    Azure 上的 Web 应用程序无法使用的诊断日志记录和跟踪领域是 Windows ETW 事件和常见的 Windows 事件日志(例如系统、应用程序和安全事件日志)。由于 ETW 跟踪信息可能在计算机范围内可见(使用正确的 ACL),因此阻止了对 ETW 事件的读取和写入访问。开发人员可能会注意到用于读取和写入 ETW 事件和常见 Windows 事件日志的 API 调用似乎可以正常工作,但这是因为 WEB 应用程序“伪造”了这些调用,以便它们看起来成功。实际上,Web 应用程序代码无法访问此事件数据

    谢谢

    【讨论】:

      猜你喜欢
      • 2012-03-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-10-06
      • 2019-07-28
      • 2014-10-13
      • 1970-01-01
      相关资源
      最近更新 更多