コード例 #1
0
 public void OnNext(EventEntry value)
 {
     if (value != null && (value.Schema.Level == EventLevel.Error || value.Schema.Level == EventLevel.Critical))
     {
         EventSourceRegistrar.RecordSessionError(value);
     }
 }
コード例 #2
0
        protected EventSourceBase()
        {
            var listener = new ObservableEventListener();

            listener.EnableEvents(this, Verbosity, Keywords.All);
            listener.LogToSystemDiagnosticsTrace(); //application diagnostics will upload these to azure tables

            if (SiteUtil.InWebJob)
            {
                listener.LogToConsole();     //needed for webjob logs (e.g. https://howlongtobeatsteam.scm.azurewebsites.net/azurejobs/#/jobs)
                listener.LogSessionErrors(); // log errors so they can be sent at the end of the run
            }

            EventSourceRegistrar.RegisterEventListener(this, listener);
        }
コード例 #3
0
 public void OnError(Exception error)
 {
     EventSourceRegistrar.RecordSessionError(
         new EventEntry(Guid.Empty, -1, Invariant($"Error in SLAB provider: {error}"), new ReadOnlyCollection <object>(new object[] {}), DateTimeOffset.UtcNow,
                        new EventSchema(-1, Guid.Empty, "SLAB", EventLevel.Error, EventTask.None, "", EventOpcode.Info, "", EventKeywords.None, "", 0, new string[] {})));
 }