/// <summary> /// Creates a repository with the specified name. /// </summary> /// <param name="repository">The name of the repository, this must be unique amongst repositories.</param> /// <returns>The <see cref="ILoggerRepository"/> created for the repository.</returns> /// <remarks> /// <para> /// Creates the default type of <see cref="ILoggerRepository"/> which is a /// <see cref="log4net.Repository.Hierarchy.Hierarchy"/> object. /// </para> /// <para> /// The <paramref name="repository"/> name must be unique. Repositories cannot be redefined. /// An <see cref="Exception"/> will be thrown if the repository already exists. /// </para> /// </remarks> /// <exception cref="LogException">The specified repository already exists.</exception> public static ILoggerRepository CreateRepository(string repository) { if (repository == null) { throw new ArgumentNullException("repository"); } return(RepositorySelector.CreateRepository(repository, null)); }
/// <summary> /// Creates a domain with the specified name. /// </summary> /// <param name="domain">The name of the domain, this must be unique amongst domain.</param> /// <returns>The <see cref="ILoggerRepository"/> created for the domain.</returns> /// <remarks> /// <para> /// Creates the default type of <see cref="ILoggerRepository"/> which is a /// <see cref="log4net.Repository.Hierarchy.Hierarchy"/> object. /// </para> /// <para> /// The <paramref name="domain"/> name must be unique. Domains cannot be redefined. /// An <see cref="Exception"/> will be thrown if the domain already exists. /// </para> /// </remarks> /// <exception cref="LogException">The specified domain already exists.</exception> public static ILoggerRepository CreateDomain(string domain) { if (domain == null) { throw new ArgumentNullException("domain"); } return(RepositorySelector.CreateRepository(domain, null)); }
/// <summary> /// Creates a repository for the specified assembly and repository type. /// </summary> /// <param name="repositoryAssembly">The assembly to use to get the name of the repository.</param> /// <param name="repositoryType">A <see cref="Type"/> that implements <see cref="ILoggerRepository"/> /// and has a no arg constructor. An instance of this type will be created to act /// as the <see cref="ILoggerRepository"/> for the repository specified.</param> /// <returns>The <see cref="ILoggerRepository"/> created for the repository.</returns> /// <remarks> /// <para> /// The <see cref="ILoggerRepository"/> created will be associated with the repository /// specified such that a call to <see cref="M:GetRepository(Assembly)"/> with the /// same assembly specified will return the same repository instance. /// </para> /// </remarks> public static ILoggerRepository CreateRepository(Assembly repositoryAssembly, Type repositoryType) { if (repositoryAssembly == null) { throw new ArgumentNullException("repositoryAssembly"); } if (repositoryType == null) { throw new ArgumentNullException("repositoryType"); } return(RepositorySelector.CreateRepository(repositoryAssembly, repositoryType)); }