public void Should_Log_Api_Log_Using_Firehose_Secondary()
        {
            var id     = Convert.ToString(Guid.NewGuid());
            var apiLog = Utility.GetApiLog();

            apiLog.Id = id;
            var formatter        = JsonLogFormatter.Instance;
            var firehoseSink     = Utility.GetFirehoseSink();
            var redisLogSettings = new RedisLogSettings();
            var redisSink        = new RedisSink(redisLogSettings);
            var compositeSink    = Utility.GetCompositeSink(formatter, redisSink, firehoseSink);

            var logWriter = new LogWriter(formatter, compositeSink);

            logWriter.WriteAsync(apiLog).GetAwaiter().GetResult();
            //Thread.Sleep(40000);

            var logData   = Utility.GetEsLogDataById(id);
            var esLogId   = string.Empty;
            var logSource = string.Empty;

            logData.TryGetValue("id", out esLogId);
            logData.TryGetValue("log_source", out logSource);

            Assert.AreEqual(id, esLogId);
            Assert.IsNull(logSource);
        }
        public static RedisSink GetRedisSink()
        {
            var redisLogSettings = new RedisLogSettings
            {
                ApiSetting = new RedisSetting
                {
                    Hosts = new List <RedisHost> {
                        new RedisHost
                        {
                            Url          = "master.travel-qa-logging.l86run.use1.cache.amazonaws.com",
                            Port         = "6379",
                            IsSslEnabled = true
                        }
                    },
                    QueueName = "travel-qa-logging-api"
                },
                ExceptionSetting = new RedisSetting
                {
                    Hosts = new List <RedisHost> {
                        new RedisHost
                        {
                            Url          = "master.travel-qa-logging.l86run.use1.cache.amazonaws.com",
                            Port         = "6379",
                            IsSslEnabled = true
                        }
                    },
                    QueueName = "travel-qa-logging-exception"
                },
                TraceSetting = new RedisSetting
                {
                    Hosts = new List <RedisHost> {
                        new RedisHost
                        {
                            Url          = "master.travel-qa-logging.l86run.use1.cache.amazonaws.com",
                            Port         = "6379",
                            IsSslEnabled = true
                        }
                    },
                    QueueName = "travel-qa-logging-trace"
                }
            };

            return(new RedisSink(redisLogSettings));
        }
        public static RedisSink GetRedisSinkWithNullSettings()
        {
            RedisLogSettings redisLogSettings = null;

            return(new RedisSink(redisLogSettings));
        }