public static void Bootstrap(bool useOpenTracingCollector = false, IEpsagonConfiguration configuration = null)
        {
            var levelSwitch = new LoggingLevelSwitch(LogEventLevel.Error);

            if ((Environment.GetEnvironmentVariable("EPSAGON_DEBUG") ?? "").ToLower() == "true")
            {
                levelSwitch.MinimumLevel = LogEventLevel.Debug;
            }

            var loggerConfig = new LoggerConfiguration()
                               .MinimumLevel.ControlledBy(levelSwitch)
                               .Enrich.FromLogContext()
                               .WriteTo.Console();

            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                loggerConfig.WriteTo.EventLog("Epsagon");
            }

            var logConfig = configuration?.LogFile ?? Environment.GetEnvironmentVariable("EPSAGON_LOG_FILE");

            if (!string.IsNullOrWhiteSpace(logConfig))
            {
                loggerConfig.WriteTo.File(logConfig);
            }

            Log.Logger = loggerConfig.CreateLogger();

            if ((Environment.GetEnvironmentVariable("DISABLE_EPSAGON") ?? "").ToUpper() != "TRUE")
            {
                if (configuration != null)
                {
                    Utils.RegisterConfiguration(configuration);
                }
                else
                {
                    Utils.RegisterConfiguration(LoadConfiguration());
                }
                CustomizePipeline();

                // Use either legacy tracer or opentracing tracer
                if (useOpenTracingCollector)
                {
                    Utils.DebugLogIfEnabled("remote");
                    JaegerTracer.CreateRemoteTracer();
                }
                else
                {
                    JaegerTracer.CreateTracer();
                }
                Utils.DebugLogIfEnabled("finished bootstraping epsagon");
            }
        }