LogManager GetLogger Method (String, String) | Apache log4net™ SDK Documentation

Retrieves or creates a named logger.

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

C#
VB
C++
F#
Copy

    public static ILog GetLogger(
    	string repository,
    	string name
    )

    Public Shared Function GetLogger (
    	repository As String,
    	name As String
    ) As ILog

    public:
    static ILog^ GetLogger(
    	String^ repository,
    	String^ name
    )

    static member GetLogger :
            repository : string *
            name : string -> ILog

#### Parameters

repository
  Type: System
  String
  The repository to lookup in.
name
  Type: System
  String
  The name of the logger to retrieve.

#### Return Value

Type: ILog
The logger with the name specified.
Remarks

Retrieve a logger named as the name parameter. If the named logger already exists, then the existing instance will be returned. Otherwise, a new instance is created.

By default, loggers do not have a set level but inherit it from the hierarchy. This is one of the central features of log4net.

See Also

#### Reference

LogManager Class
GetLogger Overload
log4net Namespace