public EventSourceLoggerProvider(LoggingEventSource eventSource, EventSourceLoggerProvider next = null)
 {
     if (eventSource == null)
     {
         throw new ArgumentNullException(nameof(eventSource));
     }
     _eventSource = eventSource;
     Next         = next;
 }
        internal EventSourceLoggerProvider CreateLoggerProvider()
        {
            lock (_providerLock)
            {
                var newLoggerProvider = new EventSourceLoggerProvider(this, _loggingProviders);
                _loggingProviders = newLoggerProvider;

                // If the EventSource has already been turned on.  set the filters.
                if (_filterSpec != null)
                {
                    newLoggerProvider.SetFilterSpec(_filterSpec);
                }

                return(newLoggerProvider);
            }
        }