【发布时间】: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