in src/AWS.Logger.SeriLog/AWSLoggerSeriLogExtension.cs [38:114]
public static LoggerConfiguration AWSSeriLog(
this LoggerSinkConfiguration loggerConfiguration,
IConfiguration configuration,
IFormatProvider iFormatProvider = null,
ITextFormatter textFormatter = null,
LogEventLevel restrictedToMinimumLevel = LogEventLevel.Verbose)
{
AWSLoggerConfig config = new AWSLoggerConfig();
config.LogGroup = configuration[LOG_GROUP];
if (configuration[DISABLE_LOG_GROUP_CREATION] != null)
{
config.DisableLogGroupCreation = bool.Parse(configuration[DISABLE_LOG_GROUP_CREATION]);
}
if (configuration[NEW_LOG_GROUP_RETENTION_IN_DAYS] is string s && int.TryParse(s, out var retentionInDays))
{
config.NewLogGroupRetentionInDays = retentionInDays;
}
if (configuration[REGION] != null)
{
config.Region = configuration[REGION];
}
if (configuration[SERVICEURL] != null)
{
config.ServiceUrl = configuration[SERVICEURL];
}
if (configuration[PROFILE] != null)
{
config.Profile = configuration[PROFILE];
}
if (configuration[PROFILE_LOCATION] != null)
{
config.ProfilesLocation = configuration[PROFILE_LOCATION];
}
if (configuration[BATCH_PUSH_INTERVAL] != null)
{
config.BatchPushInterval = TimeSpan.FromMilliseconds(Int32.Parse(configuration[BATCH_PUSH_INTERVAL]));
}
if (configuration[BATCH_PUSH_SIZE_IN_BYTES] != null)
{
config.BatchSizeInBytes = Int32.Parse(configuration[BATCH_PUSH_SIZE_IN_BYTES]);
}
if (configuration[MAX_QUEUED_MESSAGES] != null)
{
config.MaxQueuedMessages = Int32.Parse(configuration[MAX_QUEUED_MESSAGES]);
}
if (configuration[LOG_STREAM_NAME] != null)
{
config.LogStreamName = configuration[LOG_STREAM_NAME];
}
if (configuration[LOG_STREAM_NAME_SUFFIX] != null)
{
config.LogStreamNameSuffix = configuration[LOG_STREAM_NAME_SUFFIX];
}
if (configuration[LOG_STREAM_NAME_PREFIX] != null)
{
config.LogStreamNamePrefix = configuration[LOG_STREAM_NAME_PREFIX];
}
if (configuration[LIBRARY_LOG_FILE_NAME] != null)
{
config.LibraryLogFileName = configuration[LIBRARY_LOG_FILE_NAME];
}
if (configuration[LIBRARY_LOG_ERRORS] != null)
{
config.LibraryLogErrors = Boolean.Parse(configuration[LIBRARY_LOG_ERRORS]);
}
if (configuration[FLUSH_TIMEOUT] != null)
{
config.FlushTimeout = TimeSpan.FromMilliseconds(Int32.Parse(configuration[FLUSH_TIMEOUT]));
}
if (configuration[AUTHENTICATION_REGION] != null)
{
config.AuthenticationRegion = configuration[AUTHENTICATION_REGION];
}
return AWSSeriLog(loggerConfiguration, config, iFormatProvider, textFormatter, restrictedToMinimumLevel);
}