DefaultRepositorySelector CreateRepository Method (String, Type) | Apache log4net™ SDK Documentation

Creates a new repository for the specified repository.

Namespace: log4net.Core
Assembly: log4net (in log4net.dll) Version: 2.0.8.0-.NET 4.0
Syntax

C#
VB
C++
F#
Copy

    public ILoggerRepository CreateRepository(
    	string repositoryName,
    	Type repositoryType
    )

    Public Function CreateRepository (
    	repositoryName As String,
    	repositoryType As Type
    ) As ILoggerRepository

    public:
    virtual ILoggerRepository^ CreateRepository(
    	String^ repositoryName,
    	Type^ repositoryType
    ) sealed

    abstract CreateRepository :
            repositoryName : string *
            repositoryType : Type -> ILoggerRepository
    override CreateRepository :
            repositoryName : string *
            repositoryType : Type -> ILoggerRepository

#### Parameters

repositoryName
  Type: System
  String
  The repository to associate with the ILoggerRepository.
repositoryType
  Type: System
  Type
  The type of repository to create, must implement ILoggerRepository. If this param is
  then the default repository type is used.

#### Return Value

Type: ILoggerRepository
The new repository.

#### Implements

IRepositorySelector
CreateRepository(String, Type)
Exceptions

Exception | Condition
--- | ---
ArgumentNullException | repositoryName is .
LogException | repositoryName already exists.

Remarks

The ILoggerRepository created will be associated with the repository specified such that a call to [M:GetRepository(string)] with the same repository specified will return the same repository instance.

See Also

#### Reference

DefaultRepositorySelector Class
CreateRepository Overload
log4net.Core Namespace