Ejemplo n.º 1
0
        public TomatoLogClientRabbitMQTest()
        {
            EventRabbitMQOptions options = new EventRabbitMQOptions
            {
                Logger       = null,
                LogLevel     = Microsoft.Extensions.Logging.LogLevel.Information,
                ProjectLabel = "20272",
                ProjectName  = "TomatoLog",
                SysOptions   = new EventSysOptions
                {
                    EventId     = true,
                    IP          = true,
                    IPList      = true,
                    MachineName = true,
                    ProcessId   = true,
                    ProcessName = true,
                    ThreadId    = true,
                    Timestamp   = true,
                    UserName    = true
                },
                Tags         = null,
                Version      = "1.0.1",
                Exchange     = "TomatoLog-Exchange",
                ExchangeType = "direct",
                Host         = "127.0.0.1",
                Password     = "******",
                Port         = 5672,
                QueueName    = "TomatoLog-Queue",
                RouteKey     = "All",
                UserName     = "******",
                vHost        = "TomatoLog"
            };

            client = new TomatoLogClientRabbitMQ(options);
        }
        /// <summary>
        /// Use RabbitMQ with options
        /// </summary>
        /// <param name="optionAction"></param>
        /// <returns></returns>
        public TomatoLogSinkOptions UseRabbitMq(Action <EventRabbitMQOptions> optionAction = null)
        {
            if (optionAction != null)
            {
                var option = RabbitMqOptions ?? new EventRabbitMQOptions();
                optionAction(option);
                RabbitMqOptions = option;
            }

            FlowType = LogFlowTypes.RabbitMq;
            return(this);
        }
Ejemplo n.º 3
0
        public TomatoLogClientRabbitMQ(EventRabbitMQOptions options) : base(options)
        {
            Check.NotNull(options.Host, nameof(options.Host));
            Check.NotNull(options.vHost, nameof(options.vHost));
            Check.NotNull(options.UserName, nameof(options.UserName));
            Check.NotNull(options.Password, nameof(options.Password));
            Check.NotNull(options.QueueName, nameof(options.QueueName));
            Check.NotNull(options.Exchange, nameof(options.Exchange));
            Check.NotNull(options.ExchangeType, nameof(options.ExchangeType));
            Check.NotNull(options.RouteKey, nameof(options.RouteKey));

            logClient    = new LogClient(options);
            optionsRedis = options;
            Instance     = this;
        }
Ejemplo n.º 4
0
 public LogClient(EventRabbitMQOptions options)
 {
     this.options = options;
 }