Example #1
0
        private void MergeJdCloudNativeConfig(JdCloudLogSinkOptions options)
        {
            PrepareForNativeClientInOptions(options);

            if (Clients != null)
            {
                foreach (var kvp in Clients.Where(o => !string.IsNullOrWhiteSpace(o.Key) && o.Value.IsValid()))
                {
                    options.UseNativeConfig(kvp.Key, c => c.SetMySelf(kvp.Value));
                }
            }
            else if (Client != null)
            {
                options.UseNativeConfig(Client.Key, c => c.SetMySelf(Client));
            }
        }
Example #2
0
        private static void PrepareForNativeClientInOptions(JdCloudLogSinkOptions options)
        {
            if (options.HasLegalNativeConfig(false))
            {
                return;
            }

            if (options.HasLegalNativeConfig(true))
            {
                return;
            }

            options.UseNativeConfig(Constants.DefaultClient, c => {
                c.LogStreamName   = options.LogStreamName;
                c.SecretKey       = options.SecretKey;
                c.AccessKey       = options.AccessKey;
                c.RetryTimes      = options.RetryTimes;
                c.RequestTimeout  = options.RequestTimeout;
                c.Security        = options.Security;
                c.IsGeneralClient = true;
            });
        }