in src/AWS.Logger.Core/Core/AWSLoggerCore.cs [77:109]
public AWSLoggerCore(AWSLoggerConfig config, string logType)
{
_config = config;
_logType = logType;
var awsConfig = new AmazonCloudWatchLogsConfig();
if (!string.IsNullOrWhiteSpace(_config.ServiceUrl))
{
var serviceUrl = _config.ServiceUrl.Trim();
awsConfig.ServiceURL = serviceUrl;
if (serviceUrl.StartsWith("http://", StringComparison.OrdinalIgnoreCase))
{
awsConfig.UseHttp = true;
}
}
else
{
if (!string.IsNullOrEmpty(_config.Region))
{
awsConfig.RegionEndpoint = Amazon.RegionEndpoint.GetBySystemName(_config.Region);
}
}
var credentials = DetermineCredentials(config);
_client = new AmazonCloudWatchLogsClient(credentials, awsConfig);
((AmazonCloudWatchLogsClient)this._client).BeforeRequestEvent += ServiceClientBeforeRequestEvent;
((AmazonCloudWatchLogsClient)this._client).ExceptionEvent += ServiceClienExceptionEvent;
StartMonitor();
RegisterShutdownHook();
}