log4net SDK Reference

DefaultRepositorySelector.CreateRepository Method (String, Type)

Creates a new repository for the specified repository.

[Visual Basic]
NotOverridable Overloads Public Function CreateRepository( _
   ByVal repositoryName As String, _
   ByVal repositoryType As Type _
) As ILoggerRepository _
    Implements IRepositorySelector.CreateRepository
[C#]
public ILoggerRepository CreateRepository(
   string repositoryName,
   Type repositoryType
);

Parameters

repositoryName
The repository to associate with the ILoggerRepository.
repositoryType
The type of repository to create, must implement ILoggerRepository. If this param is a null reference (Nothing in Visual Basic) then the default repository type is used.

Return Value

The new repository.

Implements

IRepositorySelector.CreateRepository

Remarks

The ILoggerRepository created will be associated with the repository specified such that a call to GetRepository with the same repository specified will return the same repository instance.

Exceptions

Exception TypeCondition
ArgumentNullExceptionrepositoryName is a null reference (Nothing in Visual Basic).
LogExceptionrepositoryName already exists.

See Also

DefaultRepositorySelector Class | log4net.Core Namespace | DefaultRepositorySelector.CreateRepository Overload List