SecurityContextProvider ClassApache log4net™ SDK Documentation
The SecurityContextProvider providers default SecurityContext instances.
Inheritance Hierarchy

SystemObject
  log4net.CoreSecurityContextProvider

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

public class SecurityContextProvider

The SecurityContextProvider type exposes the following members.

Constructors

  NameDescription
Protected methodSecurityContextProvider
Protected default constructor to allow subclassing
Top
Properties

  NameDescription
Public propertyStatic memberDefaultProvider
Gets or sets the default SecurityContextProvider
Top
Methods

  NameDescription
Public methodCreateSecurityContext
Create a SecurityContext for a consumer
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.)
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.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a String that represents the current Object.
(Inherited from Object.)
Top
Remarks

A configured component that interacts with potentially protected system resources uses a SecurityContext to provide the elevated privileges required. If the SecurityContext object has been not been explicitly provided to the component then the component will request one from this SecurityContextProvider.

By default the DefaultProvider is an instance of SecurityContextProvider which returns only NullSecurityContext objects. This is a reasonable default where the privileges required are not know by the system.

This default behavior can be overridden by subclassing the SecurityContextProvider and overriding the CreateSecurityContext(Object) method to return the desired SecurityContext objects. The default provider can be replaced by programmatically setting the value of the DefaultProvider property.

An alternative is to use the log4net.Config.SecurityContextProviderAttribute This attribute can be applied to an assembly in the same way as the log4net.Config.XmlConfiguratorAttribute". The attribute takes the type to use as the SecurityContextProvider as an argument.

See Also

Reference