本文整理汇总了C#中ObservableEventListener.LogToEventHubUsingHttp方法的典型用法代码示例。如果您正苦于以下问题:C# ObservableEventListener.LogToEventHubUsingHttp方法的具体用法?C# ObservableEventListener.LogToEventHubUsingHttp怎么用?C# ObservableEventListener.LogToEventHubUsingHttp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObservableEventListener
的用法示例。
在下文中一共展示了ObservableEventListener.LogToEventHubUsingHttp方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateListener
/// <summary>
/// Creates an event listener that logs using an <see cref="EventHubHttpSink" />.
/// </summary>
/// <param name="eventHubNamespace">The namespace of the eventhub.</param>
/// <param name="eventHubName">The name of the eventhub.</param>
/// <param name="publisherId">The id of the event publisher.</param>
/// <param name="sasToken">The shared access signature token.</param>
/// <param name="bufferingInterval">The buffering interval between each batch publishing.</param>
/// <param name="bufferingCount">The number of entries that will trigger a batch publishing.</param>
/// <param name="maxBufferSize">The maximum number of entries that can be buffered while it's sending to the store before the sink starts dropping entries.</param>
/// <param name="onCompletedTimeout">Defines a timeout interval for when flushing the entries after an <see cref="OnCompleted"/> call is received and before disposing the sink.
/// This means that if the timeout period elapses, some event entries will be dropped and not sent to the store. Normally, calling <see cref="IDisposable.Dispose"/> on
/// the <see cref="System.Diagnostics.Tracing.EventListener"/> will block until all the entries are flushed or the interval elapses.
/// If <see langword="null"/> is specified, then the call will block indefinitely until the flush operation finishes.</param>
/// <returns>
/// An event listener that uses <see cref="EventHubHttpSink" /> to log events.
/// </returns>
public static EventListener CreateListener(string eventHubNamespace, string eventHubName, string publisherId, string sasToken, TimeSpan? bufferingInterval = null, int bufferingCount = Buffering.DefaultBufferingCount, TimeSpan? onCompletedTimeout = null, int maxBufferSize = Buffering.DefaultMaxBufferSize)
{
var listener = new ObservableEventListener();
listener.LogToEventHubUsingHttp(eventHubNamespace, eventHubName, publisherId, sasToken, bufferingInterval, bufferingCount, onCompletedTimeout, maxBufferSize);
return listener;
}