Example #1
0
        public void OperationResult(ZOperationResultLog operationResultLog)
        {
            if (!String.IsNullOrEmpty(operationResultLog.Log))
            {
                JsonSerializerSettings jsonSettings = new JsonSerializerSettings
                {
                    Formatting            = Formatting.None,
                    ReferenceLoopHandling = ReferenceLoopHandling.Ignore
                };

                LogEventInfo logEventInfo = new LogEventInfo(LogLevel.Trace, Log.Name, operationResultLog.Log);
                if (operationResultLog.ErrorException != null)
                {
                    logEventInfo.Exception = operationResultLog.ErrorException;
                    logEventInfo.Level     = LogLevel.Fatal;
                }
                else
                {
                    logEventInfo.Level = !operationResultLog.Ok ? LogLevel.Error : LogLevel.Warn;
                }
                // data.OperationResultOk:False
                // data.OperationResultOk:True
                logEventInfo.Properties["X-ELMAHIO-SEARCH-OperationResultOk"] = operationResultLog.Ok.ToString();
                logEventInfo.Properties["OperationResult"] =
                    JsonConvert.SerializeObject(operationResultLog, jsonSettings);

                Log.Log(logEventInfo);
            }
        }
Example #2
0
 public void OperationResult(ZOperationResultLog operationResultLog)
 {
 }