示例#1
0
        protected override void Write(NLog.Common.AsyncLogEventInfo logEvent)
        {
            try
            {
                var document = ToDocument(logEvent.LogEvent);
                logCollection.Insert(document);

                logEvent.Continuation(null);
            }
            catch (Exception ex )
            {
                logEvent.Continuation(ex);
            }
        }
		protected override void Write(NLog.Common.AsyncLogEventInfo logEvent) {
			WriteAsync(logEvent.LogEvent).ContinueWith(task => {
				logEvent.Continuation(task.Exception);
			});
		}