Logger ClassApache log4net™ SDK Documentation
Implementation of ILogger used by Hierarchy
Inheritance Hierarchy

SystemObject
  log4net.Repository.HierarchyLogger
    log4net.Repository.HierarchyRootLogger

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

public abstract class Logger : IAppenderAttachable, 
	ILogger

The Logger type exposes the following members.

Constructors

  NameDescription
Protected methodLogger
This constructor created a new Logger instance and sets its name.
Top
Properties

  NameDescription
Public propertyAdditivity
Gets or sets a value indicating if child loggers inherit their parent's appenders.
Public propertyAppenders
Get the appenders contained in this logger as an ICollection.
Public propertyEffectiveLevel
Gets the effective level for this logger.
Public propertyHierarchy
Gets or sets the Hierarchy where this Logger instance is attached to.
Public propertyLevel
Gets or sets the assigned Level, if any, for this Logger.
Public propertyName
Gets the logger name.
Public propertyParent
Gets or sets the parent logger in the hierarchy.
Public propertyRepository
Gets the ILoggerRepository where this Logger instance is attached to.
Top
Methods

  NameDescription
Public methodAddAppender
Add newAppender to the list of appenders of this Logger instance.
Protected methodCallAppenders
Deliver the LoggingEvent to the attached appenders.
Public methodCloseNestedAppenders
Closes all attached appenders implementing the IAppenderAttachable interface.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
Protected methodForcedLog(LoggingEvent)
Creates a new logging event and logs the event without further checks.
Protected methodForcedLog(Type, Level, Object, Exception)
Creates a new logging event and logs the event without further checks.
Public methodGetAppender
Look for the appender named as name
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodIsEnabledFor
Checks if this logger is enabled for a given Level passed as parameter.
Public methodLog(LoggingEvent)
This is the most generic printing method that is intended to be used by wrappers.
Public methodLog(Level, Object, Exception)
This is the most generic printing method. This generic form is intended to be used by wrappers
Public methodLog(Type, Level, Object, Exception)
This generic form is intended to be used by wrappers.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodRemoveAllAppenders
Remove all previously added appenders from this Logger instance.
Public methodRemoveAppender(String)
Remove the appender passed as parameter form the list of appenders.
Public methodRemoveAppender(IAppender)
Remove the appender passed as parameter form the list of appenders.
Public methodToString
Returns a String that represents the current Object.
(Inherited from Object.)
Top
Remarks

Internal class used to provide implementation of ILogger interface. Applications should use LogManager to get logger instances.

This is one of the central classes in the log4net implementation. One of the distinctive features of log4net are hierarchical loggers and their evaluation. The Hierarchy organizes the Logger instances into a rooted tree hierarchy.

The Logger class is abstract. Only concrete subclasses of Logger can be created. The ILoggerFactory is used to create instances of this type for the Hierarchy.

See Also

Reference