C# Класс NLog.Targets.Target

Represents logging target.
Наследование: ISupportsInitialize, INLogConfigurationItem, IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Dispose ( ) : void

Closes the target.

Flush ( AsyncContinuation asyncContinuation ) : void

Flush any pending log messages (in case of asynchronous targets).

PrecalculateVolatileLayouts ( LogEventInfo logEvent ) : void

Calls the Layout.Precalculate on each volatile layout used by this target.

ToString ( ) : string

Returns a System.String that represents this instance.

WriteAsyncLogEvent ( NLog.Common.AsyncLogEventInfo logEvent ) : void

Writes the log to the target.

WriteAsyncLogEvents ( ) : void

Writes the array of log events.

Защищенные методы

Метод Описание
CloseTarget ( ) : void

Closes the target and releases any unmanaged resources.

Dispose ( bool disposing ) : void

Releases unmanaged and - optionally - managed resources.

FlushAsync ( AsyncContinuation asyncContinuation ) : void

Flush any pending log messages asynchronously (in case of asynchronous targets).

InitializeTarget ( ) : void

Initializes the target. Can be used by inheriting classes to initialize logging.

Write ( NLog.Common.AsyncLogEventInfo logEvent ) : void

Writes log event to the log target. Must be overridden in inheriting classes.

Write ( LogEventInfo logEvent ) : void

Writes logging event to the log target. classes.

Приватные методы

Метод Описание
Close ( ) : void

Closes this instance.

CreateInitException ( ) : Exception
GetAllLayouts ( ) : void
ISupportsInitialize ( ) : void

Closes this instance.

ISupportsInitialize ( LoggingConfiguration configuration ) : void

Initializes this instance.

Initialize ( LoggingConfiguration configuration ) : void

Initializes this instance.

WriteAsyncLogEvents ( NLog.Common.AsyncLogEventInfo logEventInfos, AsyncContinuation continuation ) : void

Описание методов

CloseTarget() защищенный Метод

Closes the target and releases any unmanaged resources.
protected CloseTarget ( ) : void
Результат void

Dispose() публичный Метод

Closes the target.
public Dispose ( ) : void
Результат void

Dispose() защищенный Метод

Releases unmanaged and - optionally - managed resources.
protected Dispose ( bool disposing ) : void
disposing bool True to release both managed and unmanaged resources; false to release only unmanaged resources.
Результат void

Flush() публичный Метод

Flush any pending log messages (in case of asynchronous targets).
public Flush ( AsyncContinuation asyncContinuation ) : void
asyncContinuation AsyncContinuation The asynchronous continuation.
Результат void

FlushAsync() защищенный Метод

Flush any pending log messages asynchronously (in case of asynchronous targets).
protected FlushAsync ( AsyncContinuation asyncContinuation ) : void
asyncContinuation AsyncContinuation The asynchronous continuation.
Результат void

InitializeTarget() защищенный Метод

Initializes the target. Can be used by inheriting classes to initialize logging.
protected InitializeTarget ( ) : void
Результат void

PrecalculateVolatileLayouts() публичный Метод

Calls the Layout.Precalculate on each volatile layout used by this target.
public PrecalculateVolatileLayouts ( LogEventInfo logEvent ) : void
logEvent LogEventInfo /// The log event. ///
Результат void

ToString() публичный Метод

Returns a System.String that represents this instance.
public ToString ( ) : string
Результат string

Write() защищенный Метод

Writes log event to the log target. Must be overridden in inheriting classes.
protected Write ( NLog.Common.AsyncLogEventInfo logEvent ) : void
logEvent NLog.Common.AsyncLogEventInfo Log event to be written out.
Результат void

Write() защищенный Метод

Writes logging event to the log target. classes.
protected Write ( LogEventInfo logEvent ) : void
logEvent LogEventInfo /// Logging event to be written out. ///
Результат void

WriteAsyncLogEvent() публичный Метод

Writes the log to the target.
public WriteAsyncLogEvent ( NLog.Common.AsyncLogEventInfo logEvent ) : void
logEvent NLog.Common.AsyncLogEventInfo Log event to write.
Результат void

WriteAsyncLogEvents() публичный Метод

Writes the array of log events.
public WriteAsyncLogEvents ( ) : void
Результат void