Click or drag to resize
LoggerSwallow Method (Task)
Logs an exception is logged at Error level if the provided task does not run to completion.

Namespace: NLog
Assembly: NLog (in NLog.dll) Version: 4.3.0
Syntax
public void Swallow(
	Task task
)

Parameters

task
Type: System.Threading.TasksTask
The task for which to log an error if it does not run to completion.

Implements

ISuppressSwallow(Task)
Remarks
This method is useful in fire-and-forget situations, where application logic does not depend on completion of task. This method is avoids C# warning CS4014 in such situations.
See Also