protected override void InitializeTarget()

in src/NLog.AWS.Logger/AWSTarget.cs [204:230]


        protected override void InitializeTarget()
        {
            if (_core != null)
            {
                _core.Close();
                _core = null;
            }

            var config = new AWSLoggerConfig(RenderSimpleLayout(LogGroup, nameof(LogGroup)))
            {
                DisableLogGroupCreation = DisableLogGroupCreation,
                Region = RenderSimpleLayout(Region, nameof(Region)),
                ServiceUrl = RenderSimpleLayout(ServiceUrl, nameof(ServiceUrl)),
                Credentials = Credentials,
                Profile = RenderSimpleLayout(Profile, nameof(Profile)),
                ProfilesLocation = RenderSimpleLayout(ProfilesLocation, nameof(ProfilesLocation)),
                BatchPushInterval = BatchPushInterval,
                BatchSizeInBytes = BatchSizeInBytes,
                MaxQueuedMessages = MaxQueuedMessages,
                LogStreamNameSuffix = RenderSimpleLayout(LogStreamNameSuffix, nameof(LogStreamNameSuffix)),
                LogStreamNamePrefix = RenderSimpleLayout(LogStreamNamePrefix, nameof(LogStreamNamePrefix)),
                LibraryLogErrors = LibraryLogErrors,
                LibraryLogFileName = LibraryLogFileName
            };
            _core = new AWSLoggerCore(config, "NLog");
            _core.LogLibraryAlert += AwsLogLibraryAlert;
        }