Click or drag to resize

ImpersonatingTargetWrapper Class

Impersonates another user for the duration of the write.
Inheritance Hierarchy
SystemObject
  NLog.TargetsTarget
    NLog.Targets.WrappersWrapperTargetBase
      NLog.Targets.WrappersImpersonatingTargetWrapper

Namespace:  NLog.Targets.Wrappers
Assembly:  NLog.WindowsIdentity (in NLog.WindowsIdentity.dll) Version: 5.3.0+26b1fda2a4988e638aa77c5dd68f6ffd321a20c9
Syntax
public class ImpersonatingTargetWrapper : WrapperTargetBase

The ImpersonatingTargetWrapper type exposes the following members.

Constructors
  NameDescription
Public methodImpersonatingTargetWrapper
Initializes a new instance of the ImpersonatingTargetWrapper class.
Public methodImpersonatingTargetWrapper(Target)
Initializes a new instance of the ImpersonatingTargetWrapper class.
Public methodImpersonatingTargetWrapper(String, Target)
Initializes a new instance of the ImpersonatingTargetWrapper class.
Top
Properties
  NameDescription
Public propertyDomain
Gets or sets Windows domain name to change context to.
Public propertyImpersonationLevel
Gets or sets the required impersonation level.
Protected propertyIsInitialized
Gets a value indicating whether the target has been initialized.
(Inherited from Target.)
Protected propertyLoggingConfiguration
Gets the logging configuration this target is part of.
(Inherited from Target.)
Public propertyLogOnProvider
Gets or sets the type of the logon provider.
Public propertyLogOnType
Gets or sets the Logon Type.
Public propertyName
Gets or sets the name of the target.
(Inherited from Target.)
Public propertyPassword
Gets or sets the user account password.
Public propertyRevertToSelf
Gets or sets a value indicating whether to revert to the credentials of the process instead of impersonating another user.
Protected propertySyncRoot
Gets the object which can be used to synchronize asynchronous operations that must rely on the .
(Inherited from Target.)
Public propertyUserName
Gets or sets username to change context to.
Public propertyWrappedTarget
Gets or sets the target that is wrapped by this target.
(Inherited from WrapperTargetBase.)
Top
Methods
  NameDescription
Protected methodCloseTarget
Closes the impersonation context.
(Overrides TargetCloseTarget.)
Public methodDispose
Closes the target.
(Inherited from Target.)
Protected methodDispose(Boolean)
Releases unmanaged and - optionally - managed resources.
(Inherited from Target.)
Public methodFlush
Flush any pending log messages (in case of asynchronous targets).
(Inherited from Target.)
Protected methodFlushAsync
Flush any pending log messages (in case of asynchronous targets).
(Overrides WrapperTargetBaseFlushAsync(AsyncContinuation).)
Protected methodInitializeTarget
Initializes the impersonation context.
(Overrides TargetInitializeTarget.)
Public methodPrecalculateVolatileLayouts
Calls the Precalculate(LogEventInfo) on each volatile layout used by this target. This method won't prerender if all layouts in this target are thread-agnostic.
(Inherited from Target.)
Protected methodRenderLogEvent(Layout, LogEventInfo)
Renders the logevent into a string-result using the provided layout
(Inherited from Target.)
Protected methodRenderLogEventT(LayoutT, LogEventInfo, T)
Renders the logevent into a result-value by using the provided layout
(Inherited from Target.)
Protected methodResolveServiceT
Resolve from DI ServiceRepository
(Inherited from Target.)
Public methodToString
Returns a string that represents the current object.
(Inherited from WrapperTargetBase.)
Protected methodWrite(AsyncLogEventInfo)
Changes the security context, forwards the call to the WrappedTarget.Write() and switches the context back to original.
(Overrides TargetWrite(AsyncLogEventInfo).)
Protected methodWrite(IListAsyncLogEventInfo)
Changes the security context, forwards the call to the WrappedTarget.Write() and switches the context back to original.
(Overrides TargetWrite(IListAsyncLogEventInfo).)
Protected methodWrite(LogEventInfo)
Writes logging event to the log target. Must be overridden in inheriting classes.
(Inherited from WrapperTargetBase.)
Public methodWriteAsyncLogEvent
Writes the log to the target.
(Inherited from Target.)
Public methodWriteAsyncLogEvents(AsyncLogEventInfo)
Writes the array of log events.
(Inherited from Target.)
Public methodWriteAsyncLogEvents(IListAsyncLogEventInfo)
Writes the array of log events.
(Inherited from Target.)
Protected methodWriteAsyncThreadSafe(AsyncLogEventInfo)
Writes a log event to the log target, in a thread safe manner. Any override of this method has to provide their own synchronization mechanism. !WARNING! Custom targets should only override this method if able to provide their own synchronization mechanism. Layout-objects are not guaranteed to be thread-safe, so using them without a SyncRoot-object can be dangerous.
(Inherited from Target.)
Protected methodWriteAsyncThreadSafe(IListAsyncLogEventInfo)
Writes an array of logging events to the log target, in a thread safe manner. Any override of this method has to provide their own synchronization mechanism. !WARNING! Custom targets should only override this method if able to provide their own synchronization mechanism. Layout-objects are not guaranteed to be thread-safe, so using them without a SyncRoot-object can be dangerous.
(Inherited from Target.)
Protected methodWriteFailedNotInitialized
LogEvent is written to target, but target failed to successfully initialize
(Inherited from Target.)
Top
Remarks
See Also