/// <summary>
        /// Get the child with this name
        /// </summary>
        public IModuleLogger GetChild(string name, Type targetType)
        {
            lock (_children)
            {
                // Clone with same name
                if (string.IsNullOrEmpty(name))
                {
                    return(Clone(targetType));
                }

                // Clone of existing child
                if (_children.ContainsKey(name))
                {
                    return(_children[name].Clone(targetType));
                }

                var childName = $"{Name}.{name}";
                var config    = _config.ChildConfigs.FirstOrDefault(item => item.LoggerName == childName);
                if (config == null)
                {
                    config = new ModuleLoggerConfig {
                        LoggerName = childName, ActiveLevel = Parent?.ActiveLevel ?? LogLevel.Info
                    };
                    _config.ChildConfigs.Add(config);
                }

                _children[name] = new Logger(config, targetType, _logTargetFactory, LogQueue)
                {
                    Parent = this
                };

                return(_children[name]);
            }
        }
        /// <summary>
        /// Constructor used for create child
        /// </summary>
        /// <param name="config">Top level logger config</param>
        /// <param name="logQueue">Global stream listener</param>
        /// <param name="factory">Factory to create additional logger</param>
        /// <param name="targetType">Type this logger is assigned to</param>
        /// <param name="logTarget">Existing log instance for loggers of same name</param>
        private Logger(ModuleLoggerConfig config, Type targetType, ILogTargetFactory factory, ILogTarget logTarget, BlockingCollection <LogMessage> logQueue)
        {
            _config           = config;
            _logTargetFactory = factory;
            _hostName         = targetType.Name;
            _targetLog        = logTarget ?? factory.Create(_config.LoggerName);
            LogQueue          = logQueue;

            // Put this instance to the clone cache for later reuse.
            _cloneCache[_hostName] = this;
        }
 /// <summary>
 /// Constructor invoked by the logger management
 /// </summary>
 /// <param name="config">Top level logger config</param>
 /// <param name="targetType">Type this logger is assigned to</param>
 /// <param name="factory">Factory to create additional logger</param>
 /// <param name="logQueue">Global stream listener</param>
 internal Logger(ModuleLoggerConfig config, Type targetType, ILogTargetFactory factory, BlockingCollection <LogMessage> logQueue)
     : this(config, targetType, factory, null, logQueue)
 {
 }