output-service-tsdb/Program.cs

30 lines
1.0 KiB
C#

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>();
rabbitMQWorker.ProcessMessages();
}
}
private static void ConfigureServices(IServiceCollection services)
{
services.AddLogging(configure => configure.AddConsole())
.Configure<LoggerFilterOptions>(options => options.MinLevel = LogLevel.Information)
.AddTransient<RabbitMQWorker>();
}
}
}