当前位置: 首页>>代码示例>>C#>>正文


C# ObservableEventListener.LogToSeq方法代码示例

本文整理汇总了C#中ObservableEventListener.LogToSeq方法的典型用法代码示例。如果您正苦于以下问题:C# ObservableEventListener.LogToSeq方法的具体用法?C# ObservableEventListener.LogToSeq怎么用?C# ObservableEventListener.LogToSeq使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ObservableEventListener的用法示例。


在下文中一共展示了ObservableEventListener.LogToSeq方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateListener

 /// <summary>
 /// Creates an event listener that logs using a <see cref="SeqSink" />.
 /// </summary>
 /// <param name="serverUrl">The base URL of the Seq server that log events will be written to.</param>
 /// <param name="apiKey">A Seq <i>API key</i> that authenticates the client to the Seq server.</param>
 /// <param name="bufferingInterval">The buffering interval between each batch publishing. Default value is <see cref="Buffering.DefaultBufferingInterval" />.</param>
 /// <param name="listenerDisposeTimeout">Time limit for flushing the entries after an <see cref="SeqSink.OnCompleted" /> call is received and before disposing the sink.</param>
 /// <param name="bufferingCount">Number of entries that will trigger batch publishing. Default is <see cref="Buffering.DefaultBufferingCount" /></param>
 /// <param name="maxBufferSize">The maximum number of entries that can be buffered before the sink starts dropping entries.
 /// 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="SeqSink" /> to log events.
 /// </returns>
 public static EventListener CreateListener(
     string serverUrl,
     string apiKey = null,
     TimeSpan? bufferingInterval = null,
     TimeSpan? listenerDisposeTimeout = null,
     int bufferingCount = Buffering.DefaultBufferingCount,
     int maxBufferSize = Buffering.DefaultMaxBufferSize)
 {
     var listener = new ObservableEventListener();
     listener.LogToSeq(serverUrl, apiKey, bufferingInterval, listenerDisposeTimeout, bufferingCount, maxBufferSize);
     return listener;
 }
开发者ID:DimensionDataCBUSydney,项目名称:seq-client,代码行数:27,代码来源:SeqLog.cs

示例2: Main

        static void Main()
        {
            using (var listener = new ObservableEventListener())
            {
                listener.EnableEvents(SampleEventSource.Log, EventLevel.LogAlways, SampleEventSource.Keywords.SampleApp);

                listener.LogToConsole();
                listener.LogToSeq("http://my-seq");

                SampleEventSource.Log.Greeting(Environment.UserName);
            }

            Console.WriteLine("Done");
            Console.ReadKey(true);
        }
开发者ID:rohanbaraskar,项目名称:SeleniumAutomationFramework,代码行数:15,代码来源:Program.cs


注:本文中的ObservableEventListener.LogToSeq方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。