Beispiel #1
0
        private ILoggerRepository CreateRepository(Log4NetSettings settings)
        {
            ILoggerRepository CreateAndInitializeRepo(string repoName)
            {
                var repo       = LogManager.CreateRepository(repoName);
                var configFile = GetConfigFileFullPath(settings.ConfigFile);

                if (File.Exists(configFile))
                {
                    ConfigureRepositoryFromXml(repo, configFile, settings.Watch);
                }
                else
                {
                    BasicConfigurator.Configure(repo);
                }

                return(repo);
            }

            return(_repositoryCache.GetOrAdd(settings.RootRepository, CreateAndInitializeRepo));
        }
Beispiel #2
0
 public void Initialize(Log4NetSettings settings)
 {
     _loggerRepository = CreateRepository(settings);
 }