private static void Enqueue(XElement logEntry)
{
// Start logging if not already started, unless it is desired to start it explicitly
if(!StartExplicitly)
StartLogging();
lock(_logEntryQueue)
{
// Stop enqueueing when stop request was set or when the queue gets too full.
if(!StopLoggingRequested && _logEntryQueue.Count < 10000)
_logEntryQueue.Enqueue(logEntry);
}
}