/// <summary>
        /// Write a log message that was stored on the retry queue.
        /// </summary>
        /// <returns></returns>
        public int WriteLogMessagesOnRetryQueue()
        {
            bool writeSucceeded  = false;
            int  numMessagesSent = 0;

            for (int i = 0; i < _logRetryQueue.Count; i++)
            {
                writeSucceeded = WriteMessageToTextLog(_logRetryQueue[i], false);
                if (writeSucceeded)
                {
                    _logRetryQueue.RemoveAt(i);
                    i--;
                    numMessagesSent++;
                }
            }

            SaveRetryQueue();

            return(numMessagesSent);
        }