using OutputServiceTSDB.RabbitMQ; using Sentry; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; namespace OutputServiceTSDB { public class Program { public static void Main(string[] args) { using (SentrySdk.Init("https://744f5d479bdb4478b386173b92d081ac@sentry.kmlabz.com/12")) { var serviceCollection = new ServiceCollection(); ConfigureServices(serviceCollection); var serviceProvider = serviceCollection.BuildServiceProvider(); RabbitMQWorker rabbitMQWorker = serviceProvider.GetService(); rabbitMQWorker.ProcessMessages(); } } private static void ConfigureServices(IServiceCollection services) { services.AddLogging(configure => configure.AddConsole()) .Configure(options => options.MinLevel = LogLevel.Information) .AddTransient(); } } }