本文整理汇总了C#中ITracer.Exception方法的典型用法代码示例。如果您正苦于以下问题:C# ITracer.Exception方法的具体用法?C# ITracer.Exception怎么用?C# ITracer.Exception使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITracer
的用法示例。
在下文中一共展示了ITracer.Exception方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
public void Start(IHostingService host)
{
if (host == null)
{
throw new ArgumentNullException("host");
}
m_tracer = host.GetTracer(GetType());
m_host = host;
m_instanceName = GetInstanceName();
var tcpBaseAddress = GetTcpBaseAddress();
var httpBaseAddress = GetHealthServiceBaseAddress();
try
{
PerfCounters.Remove();
PerfCounters.Install();
}
catch (Exception e)
{
m_tracer.Exception(e);
throw;
}
var maxConcurrency = Environment.ProcessorCount * 16;
var maxPending = Environment.ProcessorCount * 16;
m_singletonServiceInstance = new DataService(
m_host.GetTracer(typeof(DataService)), this, tcpBaseAddress.Authority + ", " + m_instanceName, maxConcurrency, null);
var serviceHost = CreateServiceHost(m_singletonServiceInstance, new[] { tcpBaseAddress, httpBaseAddress }, maxConcurrency, maxPending);
serviceHost.Open();
m_serviceHost = serviceHost;
if (m_tracer.IsInfoEnabled)
{
var builder = new StringBuilder(200);
foreach (var ep in serviceHost.ChannelDispatchers)
{
if (ep.Listener != null)
{
builder.AppendLine(ep.Listener.Uri.ToString());
}
}
m_tracer.InfoFormat("Service host [{0}] started. Listening on following base URIs:{1}{2}",
m_instanceName, Environment.NewLine, builder);
}
}