using System; namespace log4net.tradeideas { /// /// Class holding configuration for this library /// internal class Config { public Config() { UserAgent = "tradeideas-log4net-appender"; TimeoutInSeconds = 30; MaxSendRetries = 3; Tag = "log4net"; LogicalThreadContextKeys = null; GlobalContextKeys = null; BufferSize = 500; NumberOfInnerExceptions = 4; SendInterval = TimeSpan.FromSeconds(5); MaxLogQueueSize = 0; // unlimited FinalFlushWaitTime = TimeSpan.FromSeconds(3); // Limitation of HTTP endpoint is 1MB per event, 5MB per bulk: // max 5MB per bulk (real 5*1024*1024 is still rejected so stay a bit under the limit) MaxBulkSizeBytes = 5242000; // Real 1024*1024 is still too much for HTTP endpoint so let's stay on safe side with 1000*1000 MaxEventSizeBytes = 1000000; } /// /// Max size of whole event sent to TradeIdeas in bytes /// public int MaxEventSizeBytes { get; set; } /// /// Max size ot one bulk of events sent to TradeIdeas in bytes /// public int MaxBulkSizeBytes { get; set; } /// /// URL where the logs are sent /// public string RootUrl { get; set; } /// /// Customer token used to send the logs /// public string CustomerToken { get; set; } /// /// User agent string used when sending the logs /// public string UserAgent { get; set; } /// /// Tag or tags separated by commas /// public string Tag { get; set; } /// /// Comma separated list of keys to LogicalThreadContext whose values will be added to log. /// public string LogicalThreadContextKeys { get; set; } /// /// Comma separated list of keys to GlobalContext whose values will be added to log. /// public string GlobalContextKeys { get; set; } /// /// Size of sending buffer /// public int BufferSize { get; set; } /// /// Maximal size of queue holding logs before send /// public int MaxLogQueueSize { get; set; } /// /// How many inner exceptions should be sent to TradeIdeas /// public int NumberOfInnerExceptions { get; set; } /// /// How often should the events buffer be sent if it's not yet full /// public TimeSpan SendInterval { get; set; } /// /// How long to wait during final appender flush until all messages are flushed. /// public TimeSpan FinalFlushWaitTime { get; set; } /// /// Request timeout when sending logs to TradeIdeas /// public int TimeoutInSeconds { get; set; } /// /// How many times library tries to send logs to TradeIdeas before giving up and trying next batch. /// public int MaxSendRetries { get; set; } } }