/// <summary>
        /// See <see cref="ILogHelper.DefineFatalLogMessage"/> for more details.
        /// </summary>
        /// <param name="message">
        /// The message to be logged.
        /// </param>
        /// <param name="errorCategory">
        /// The specifics of the error origin.
        /// </param>
        /// <param name="errorType">
        /// The type of error being logged.
        /// </param>
        /// <param name="exception">
        /// The exception (if one exists) associated with the error.
        /// </param>
        /// <returns>
        /// A new, initalised <see cref="LogMessage"/> instance.
        /// </returns>
        public LogMessage DefineFatalLogMessage(string message, ErrorCategory errorCategory, ErrorType errorType, BaseException exception = null)
        {
            var logMessage = new LogMessage(TraceEventType.Critical);

            logMessage.Exception = exception;
            logMessage.Message = message;
            logMessage.ErrorCode = new ErrorCode(Severity.Critical, errorCategory, errorType);

            return logMessage;
        }
        /// <summary>
        /// Creates an Information log message.
        /// </summary>
        /// <param name="message">
        /// The message to be logged.
        /// </param>
        /// <returns>
        /// A new, initalised <see cref="LogMessage"/> instance.
        /// </returns>
        public LogMessage DefineInformationLogMessage(string message)
        {
            var logMessage = new LogMessage(TraceEventType.Information);

            logMessage.Exception = null;
            logMessage.Message = message;
            logMessage.ErrorCode = new ErrorCode(Severity.Information, ErrorCategory.None, ErrorType.None);

            return logMessage;
        }
        /// <summary>
        /// Builds a log entry.
        /// </summary>
        /// <param name="logMessage">
        /// The details of the log entry to be logged.
        /// </param>
        /// <returns>
        /// A <see cref="LogEntry"/> containing the unique identifier of the log entry, and the log entry itself.
        /// </returns>
        internal LogEntry BuildLogEntry(LogMessage logMessage)
        {
            string logEntryId = BuildNextLogNumber();

            var logEntry = new LogEntry(logEntryId);
            logEntry.Message = CreateLogMessage(logMessage.Message, logMessage.Exception);
            logEntry.EventId = 0;
            logEntry.Priority = 1;
            logEntry.TimeStamp = DateTime.UtcNow;
            logEntry.MachineName = MachineName;
            logEntry.Win32ThreadId = Thread.CurrentThread.ManagedThreadId.ToString();

            if (logMessage.Exception != null)
            {
                logEntry.ExtendedProperties["errorCategory"] = logMessage.Exception.ErrorCode.Category;
                logEntry.ExtendedProperties["errorSeverity"] = logMessage.Exception.ErrorCode.Severity;
                logEntry.ExtendedProperties["errorType"] = logMessage.Exception.ErrorCode.ErrorType;
            }
            else
            {
                logEntry.ExtendedProperties["errorCategory"] = logMessage.ErrorCode.Category;
                logEntry.ExtendedProperties["errorSeverity"] = logMessage.ErrorCode.Severity;
                logEntry.ExtendedProperties["errorType"] = logMessage.ErrorCode.ErrorType;
            }

            return logEntry;
        }