Exemple #1
0
        public static void AddEventLog(this IServiceCollection services, Action <EventLogOptions> setupOptions)
        {
            if (setupOptions == null)
            {
                throw new ArgumentNullException(nameof(setupOptions));
            }

            services.Configure(setupOptions);

            services.AddScoped <IPublisherService, PublisherService>();
            services.AddScoped <IReceiverService, ReceiverService>();

            services.AddSingleton <ConsumerRegister>();
            services.AddSingleton <IBackgroundTaskQueue, BackgroundTaskQueue>();
            services.AddSingleton <SubscriptionManager>();

            services.AddHostedService <MigratorTask>();
            services.AddHostedService <RetryPublishTask>();
            services.AddHostedService <RetryHandlerTask>();
            services.AddHostedService <ReceivedHandlerTask>();
            services.AddHostedService <PublisherTask>();
            services.AddHostedService <ReplyTask>();

            var options = new EventLogOptions();

            setupOptions(options);

            foreach (var optionsExtension in options.Extensions)
            {
                optionsExtension.AddServices(services);
            }
        }
Exemple #2
0
        public void Configure
        (
            IWin32Window Parent,
            ServerSettings Settings,
            string ServerDirectory
        )
        {
            using (LoggingModuleConfigurationManager configManager = new LoggingModuleConfigurationManager(false))
            {
                configManager.Load(ServerDirectory);

                LoggingState state = configManager.GetLoggingState( );

                EventLogOptions mainLoggingUI = new EventLogOptions( );

                EventLogConfigurationPresenter presenter = new EventLogConfigurationPresenter( );

                presenter.RunView(mainLoggingUI.EventLogConfigurationView, state);

                if (mainLoggingUI.ShowDialog( ) == DialogResult.OK)
                {
                    presenter.UpdateState( );

                    configManager.SetLoggingState(state);

                    configManager.Save( );
                }
                else
                {
                    presenter.ResetView( );
                }
            }
        }
 public PublisherService(IPublishedStore publishedStore, IBackgroundTaskQueue backgroundTaskQueue, IOptions <EventLogOptions> options,
                         ILogger <PublisherService> logger)
 {
     _publishedStore      = publishedStore;
     _backgroundTaskQueue = backgroundTaskQueue;
     _logger  = logger;
     _options = options.Value;
 }
        public static void AddRabbitmq(this EventLogOptions eventLogOptions, RabbitMqConfiguration options)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            eventLogOptions.RegisterExtension(new RabbitMQExtension(options));
        }
Exemple #5
0
 public ReceivedHandlerTask(IBackgroundTaskQueue taskQueue,
                            ILogger <ReceivedHandlerTask> logger, IBackgroundTaskQueue taskQueue1,
                            SubscriptionManager subscriptionManager, IServiceProvider serviceProvider, IOptions <EventLogOptions> options)
 {
     _shutdown            = new CancellationTokenSource();
     _taskQueue           = taskQueue;
     _logger              = logger;
     _taskQueue           = taskQueue1;
     _subscriptionManager = subscriptionManager;
     _serviceProvider     = serviceProvider;
     _options             = options.Value;
 }
Exemple #6
0
 public LogManager(EventLogOptions loggerOptions) : base(loggerOptions)
 {
 }
Exemple #7
0
 public LogWriter(EventLogOptions loggerOptions) : base(loggerOptions)
 {
 }
Exemple #8
0
 protected LogHandler(EventLogOptions eventLogOptions)
 {
     _eventLogOptions = eventLogOptions;
 }
 public static void UsePostgres(this EventLogOptions options, Action <PostgreSqlOptions> setupOptions)
 {
     options.RegisterExtension(new PostgreSqlExtension(setupOptions));
 }