using System; using Amazon.Runtime; namespace AWS.Logger { /// /// Configuration options for logging messages to AWS CloudWatch Logs /// public interface IAWSLoggerConfig { /// /// Gets the LogGroup property. This is the name of the CloudWatch Logs group where /// streams will be created and log messages written to. /// string LogGroup { get; } /// /// Determines whether or not to create a new Log Group, if the one specified by doesn't already exist /// If false (the default), the Log Group is created if it doesn't already exist. This requires logs:DescribeLogGroups /// permission to determine if the group exists, and logs:CreateLogGroup permission to create the group if it doesn't already exist. /// If true, creation of Log Groups is disabled. Logging functions only if the specified log group already exists. /// When creation of log groups is disabled, logs:DescribeLogGroups permission is NOT required. /// bool DisableLogGroupCreation { get; set; } /// /// Gets the Profile property. The profile is used to look up AWS credentials in the profile store. /// /// For understanding how credentials are determine view the top level documentation for AWSLoggerConfig class. /// /// string Profile { get; } /// /// Gets the ProfilesLocation property. If this is not set the default profile store is used by the AWS SDK for .NET /// to look up credentials. This is most commonly used when you are running an application of on-priemse under a service account. /// /// For understanding how credentials are determine view the top level documentation for AWSLoggerConfig class. /// /// string ProfilesLocation { get; } /// /// Gets the Credentials property. These are the AWS credentials used by the AWS SDK for .NET to make service calls. /// /// For understanding how credentials are determine view the top level documentation for AWSLoggerConfig class. /// /// AWSCredentials Credentials { get; } /// /// Gets the Region property. This is the AWS Region that will be used for CloudWatch Logs. If this is not /// the AWS SDK for .NET will use its fall back logic to try and determine the region through environment variables and EC2 instance metadata. /// If the Region is not set and no region is found by the SDK's fall back logic then an exception will be thrown. /// string Region { get; } /// /// Gets and sets of the ServiceURL property. This is an optional property; change /// it only if you want to try a different service endpoint. Ex. for LocalStack /// string ServiceUrl { get; } /// /// Gets the BatchPushInterval property. For performance the log messages are sent to AWS in batch sizes. BatchPushInterval /// dictates the frequency of when batches are sent. If either BatchPushInterval or BatchSizeInBytes are exceeded the batch will be sent. /// /// The default is 3 seconds. /// /// TimeSpan BatchPushInterval { get; } /// /// Gets the BatchSizeInBytes property. For performance the log messages are sent to AWS in batch sizes. BatchSizeInBytes /// dictates the total size of the batch in bytes when batches are sent. If either BatchPushInterval or BatchSizeInBytes are exceeded the batch will be sent. /// /// The default is 100 Kilobytes. /// /// int BatchSizeInBytes { get; } /// /// Gets and sets the MaxQueuedMessages property. This specifies the maximum number of log messages that could be stored in-memory. MaxQueuedMessages /// dictates the total number of log messages that can be stored in-memory. If this is exceeded, incoming log messages will be dropped. /// /// The default is 10000. /// /// int MaxQueuedMessages { get; } /// /// Gets and sets the LogStreamNameSuffix property. The LogStreamName consists of an optional user-defined LogStreamNamePrefix (that can be set here) /// followed by a DateTimeStamp as the prefix, and a user defined suffix value /// The LogstreamName then follows the pattern '[LogStreamNamePrefix]-[DateTime.Now.ToString("yyyy/MM/ddTHH.mm.ss")]-[LogStreamNameSuffix]' /// /// The default is new a Guid. /// /// string LogStreamNameSuffix { get; } /// /// Gets and sets the LogStreamNamePrefix property. The LogStreamName consists of an optional user-defined LogStreamNamePrefix (that can be set here) /// followed by a DateTimeStamp as the prefix, and a user defined suffix value /// The LogstreamName then follows the pattern '[LogStreamNamePrefix]-[DateTime.Now.ToString("yyyy/MM/ddTHH.mm.ss")]-[LogStreamNameSuffix]' /// /// The default is an empty string. /// /// string LogStreamNamePrefix { get; set; } /// /// Gets and sets the LibraryLogErrors property. This is the boolean value of whether or not you would like this library to log logging errors. /// /// The default is "true". /// /// bool LibraryLogErrors { get; set; } /// /// Gets and sets the LibraryLogFileName property. This is the name of the file into which errors from the AWS.Logger.Core library will be written into. /// /// The default is going to "aws-logger-errors.txt". /// /// string LibraryLogFileName { get; } /// /// Gets the FlushTimeout property. The value is in milliseconds. When performing a flush of the in-memory queue this is the maximum period of time allowed to send the remaining /// messages before it will be aborted. If this is exceeded, incoming log messages will be dropped. /// /// The default is 30000 milliseconds. /// /// TimeSpan FlushTimeout { get; } } }