NLog.LogEventInfo.WithContinuation C# (CSharp) Method

WithContinuation() public method

Creates AsyncLogEventInfo from this LogEventInfo by attaching the specified asynchronous continuation.
public WithContinuation ( AsyncContinuation asyncContinuation ) : NLog.Common.AsyncLogEventInfo
asyncContinuation AsyncContinuation The asynchronous continuation.
return NLog.Common.AsyncLogEventInfo
        public AsyncLogEventInfo WithContinuation(AsyncContinuation asyncContinuation)
        {
            return new AsyncLogEventInfo(this, asyncContinuation);
        }

Usage Example

Esempio n. 1
0
        private static bool WriteToTargetWithFilterChain(TargetWithFilterChain targetListHead, LogEventInfo logEvent, AsyncContinuation onException)
        {
            Target       target = targetListHead.Target;
            FilterResult result = GetFilterResult(targetListHead.FilterChain, logEvent);

            if ((result == FilterResult.Ignore) || (result == FilterResult.IgnoreFinal))
            {
                if (InternalLogger.IsDebugEnabled)
                {
                    InternalLogger.Debug("{0}.{1} Rejecting message because of a filter.", logEvent.LoggerName, logEvent.Level);
                }

                if (result == FilterResult.IgnoreFinal)
                {
                    return(false);
                }

                return(true);
            }

            target.WriteAsyncLogEvent(logEvent.WithContinuation(onException));
            if (result == FilterResult.LogFinal)
            {
                return(false);
            }

            return(true);
        }
All Usage Examples Of NLog.LogEventInfo::WithContinuation