This is near the end of this Seq Logging Implementation
This commit is contained in:
parent
78d49a9829
commit
099f6467d2
9 changed files with 212 additions and 123 deletions
|
|
@ -15,6 +15,14 @@ namespace PlanTempus.Core.ModuleRegistry
|
|||
configuration.ConnectionString = TelemetryConfig.ConnectionString;
|
||||
configuration.TelemetryChannel.DeveloperMode = true;
|
||||
|
||||
var client = new Microsoft.ApplicationInsights.TelemetryClient(configuration);
|
||||
client.Context.GlobalProperties["Application"] = GetType().Namespace.Split('.')[0];
|
||||
client.Context.GlobalProperties["MachineName"] = Environment.MachineName;
|
||||
client.Context.GlobalProperties["Version"] = Environment.Version.ToString();
|
||||
client.Context.GlobalProperties["ProcessorCount"] = Environment.ProcessorCount.ToString();
|
||||
|
||||
builder.Register(c => client).InstancePerLifetimeScope();
|
||||
|
||||
if (TelemetryConfig.UseSeqLoggingTelemetryChannel)
|
||||
{
|
||||
var messageChannel = new Telemetry.MessageChannel();
|
||||
|
|
@ -23,21 +31,13 @@ namespace PlanTempus.Core.ModuleRegistry
|
|||
.As<Telemetry.IMessageChannel<ITelemetry>>()
|
||||
.SingleInstance();
|
||||
|
||||
configuration.TelemetryChannel = new Telemetry.SeqLoggingTelemetryChannel(messageChannel);
|
||||
configuration.TelemetryChannel = new Telemetry.SeqTelemetryChannel(messageChannel, client);
|
||||
}
|
||||
|
||||
var telemetryProcessorChain = new Microsoft.ApplicationInsights.Extensibility.Implementation.TelemetryProcessorChainBuilder(configuration);
|
||||
telemetryProcessorChain.Use(next => new Telemetry.Enrichers.EnrichWithMetaTelemetry(next));
|
||||
telemetryProcessorChain.Build();
|
||||
|
||||
|
||||
var client = new Microsoft.ApplicationInsights.TelemetryClient(configuration);
|
||||
client.Context.GlobalProperties["Application"] = GetType().Namespace.Split('.')[0];
|
||||
client.Context.GlobalProperties["MachineName"] = Environment.MachineName;
|
||||
client.Context.GlobalProperties["Version"] = Environment.Version.ToString();
|
||||
client.Context.GlobalProperties["ProcessorCount"] = Environment.ProcessorCount.ToString();
|
||||
|
||||
builder.Register(c => client).InstancePerLifetimeScope();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue