static ElasticApmModule() { var configReader = new FullFrameworkConfigReader(ConsoleLogger.Instance); var agentComponents = new AgentComponents(configurationReader: configReader); // Logger should be set ASAP because other initialization steps depend on it Logger = agentComponents.Logger.Scoped(nameof(ElasticApmModule)); Logger.Debug() ?.Log($"Entered {nameof(ElasticApmModule)} static ctor" + $"; .NET Runtime description: {PlatformDetection.DotNetRuntimeDescription}" + $"; IIS: {IisVersion}"); // FindAspNetVersion uses Logger var aspNetVersion = FindAspNetVersion(); Logger.Debug()?.Log($"ASP.NET version: {aspNetVersion}"); SetServiceInformation(agentComponents.Service, aspNetVersion); Agent.Setup(agentComponents); IsCaptureHeadersEnabled = Agent.Instance.ConfigurationReader.CaptureHeaders; Agent.Instance.Subscribe(new HttpDiagnosticsSubscriber()); }
static ElasticApmModule() { var configReader = new FullFrameworkConfigReader(ConsoleLogger.Instance); var agentComponents = new AgentComponents(configurationReader: configReader); SetServiceInformation(agentComponents.Service); Agent.Setup(agentComponents); Logger = Agent.Instance.Logger.Scoped(nameof(ElasticApmModule)); Logger.Debug() ?.Log($"Entered {nameof(ElasticApmModule)} static ctor: ASP.NET: {AspNetVersion}, CLR: {ClrDescription}, IIS: {IisVersion}"); IsCaptureHeadersEnabled = Agent.Instance.ConfigurationReader.CaptureHeaders; Agent.Instance.Subscribe(new HttpDiagnosticsSubscriber()); }