public static ILoggingBuilder AddLogDNA(
            this ILoggingBuilder builder,
            string ingestionKey)
        {
            var options = new LogDNAOptions(ingestionKey);

            return(builder.AddLogDNA(options));
        }
        public static ILoggerFactory AddLogDNA(
            this ILoggerFactory factory,
            string ingestionKey)
        {
            var options = new LogDNAOptions(ingestionKey);

            return(factory.AddLogDNA(options));
        }
        public static ILoggingBuilder AddLogDNA(
            this ILoggingBuilder builder,
            LogDNAOptions options)
        {
            var client = SetUpClient(options.IngestionKey, options.HostName, options.Tags, options.LogInternalsToConsole);

            builder.AddProvider(new LogDNAProvider(client, options));
            return(builder);
        }
        public static ILoggerFactory AddLogDNA(
            this ILoggerFactory factory,
            LogDNAOptions options)
        {
            var client = SetUpClient(options.IngestionKey, options.HostName, options.Tags, options.LogInternalsToConsole);

            factory.AddProvider(new LogDNAProvider(client, options));
            return(factory);
        }
 public LogDNAProvider(IApiClient apiClient, LogDNAOptions options)
 {
     _apiClient = apiClient ?? throw new ArgumentNullException(nameof(apiClient));
     _options   = options ?? throw new ArgumentNullException(nameof(options));
 }
        private const int MaxMessageSize = 16384; // 16KB

        public LogDNALogger(string loggerName, IApiClient client, LogDNAOptions options)
        {
            _client     = client ?? throw new ArgumentNullException(nameof(client));
            _options    = options ?? throw new ArgumentNullException(nameof(options));
            _loggerName = loggerName ?? "Unknown";
        }