public Startup(IHostingEnvironment env, EventFlowLoggerConfigurator loggerConfigurator)
        {
            var builder = new ConfigurationBuilder()
                          .SetBasePath(env.ContentRootPath)
                          .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
                          .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
                          .AddEnvironmentVariables();

            Configuration = builder.Build();
            loggerConfigurator.Configure(Configuration);

            logger = loggerConfigurator.Logger;
        }
        /// <summary>
        /// This is the entry point of the service host process.
        /// </summary>
        private static void Main()
        {
            try
            {
                // **** Instantiate log collection via EventFlow
                //
                using (var diagnosticsPipeline = ServiceFabricDiagnosticPipelineFactory.CreatePipeline("StatelessWebType-DiagnosticsPipeline"))
                {
                    var loggerConfigurator = new EventFlowLoggerConfigurator(diagnosticsPipeline);

                    ServiceRuntime.RegisterServiceAsync("StatelessWebType", context => new StatelessWeb(context, loggerConfigurator)).GetAwaiter().GetResult();
                    ServiceEventSource.Current.ServiceTypeRegistered(Process.GetCurrentProcess().Id, typeof(StatelessWeb).Name);

                    KeepServiceRunning();
                }
            }
            catch (Exception e)
            {
                ServiceEventSource.Current.ServiceHostInitializationFailed(e.ToString());
                throw;
            }
        }
 public StatelessWeb(StatelessServiceContext context, EventFlowLoggerConfigurator loggerConfigurator)
     : base(context)
 {
     this.loggerConfigurator = loggerConfigurator;
 }