/// <summary> /// TraceLog /// </summary> /// <param name="nLogData"></param> public static void TraceLog(NLogData nLogData) { LogEventInfo theEvent = new LogEventInfo(LogLevel.Trace, NLogManager._logger.Name, nLogData.Message); SetLogEventInfo(theEvent, nLogData); _logger.Log(theEvent); }
/// <summary> /// Set Log Event Info /// </summary> /// <param name="theEvent"></param> /// <param name="nLogData"></param> private static void SetLogEventInfo(LogEventInfo theEvent, NLogData nLogData) { theEvent.Properties["SessionId"] = "sadsadsadasdkasdjasdjklasl"; theEvent.Properties["BrowserDetail"] = nLogData.BrowserDetail; theEvent.Properties["RequestUrl"] = nLogData.RequestUrl; theEvent.Properties["ErrorMessage"] = nLogData.ErrorMessage; theEvent.Properties["EmailBody"] = string.IsNullOrEmpty(nLogData.EmailBody) ? string.Empty : nLogData.EmailBody; theEvent.Properties["ProducerCode"] = nLogData.AgentCode; theEvent.Properties["QuoteNo"] = nLogData.QuoteNo; theEvent.Properties["CUSTOMER_IP_ADDRESS"] = nLogData.CustomerIPAddress; theEvent.Properties["SERVER_IP_ADDRESS"] = nLogData.ServerIPAddress; theEvent.Properties["POLICY_NO"] = nLogData.PolicyNumber; }