Esempio n. 1
0
        void ILogixUserEventLogger.LogEvents(LogixLogEvent payLoad)
        {
            LogixLogEvent logixLogEvent = new LogixLogEvent
            {
                AdditionalInfo = payLoad.AdditionalInfo,
                Application    = payLoad.Application,
                ConnectLoginID = payLoad.ConnectLoginID,
                EventName      = payLoad.EventName,

                SyncID           = System.Guid.NewGuid(),
                IsLoggedFromMsmq = false,               // Default value
                LogDateTime      = System.DateTime.Now, // Default value
            };

            try
            {
                if (Configuration.UseMessageQueue.ToUpper() == "YES")
                {
                    logixLogEvent.IsLoggedFromMsmq = true;
                    _queueLogger.LogUserEvents(logixLogEvent);
                }
                else
                {
                    _databaseLogger.LogUserEvents(logixLogEvent);
                }
            }
            catch (System.ServiceModel.FaultException <LogixLogFaultException> faultException)
            {
                LogException
                (
                    new LogixLogError
                {
                    ApplicationName = payLoad.Application,
                    ConnectLoginID  = payLoad.ConnectLoginID,
                    ErrorMessage    = faultException.Message,
                    Source          = "Error occured in ILogixUserEventLogger.LogEvents(LogixLogEvent payLoad) > _databaseLogger.LogUserEvents(logixLogEvent)",
                    StackTrace      = ExtractExceptionDetail(faultException)
                },
                    faultException
                );
            }
            catch (System.Exception generalException)
            {
                LogException
                (
                    new LogixLogError
                {
                    ApplicationName = payLoad.Application,
                    ConnectLoginID  = payLoad.ConnectLoginID,
                    ErrorMessage    = generalException.Message,
                    Source          = "Error occured in ILogixUserEventLogger.LogEvents(LogixLogEvent payLoad) > _databaseLogger.LogUserEvents(logixLogEvent)",
                    StackTrace      = ExtractExceptionDetail(generalException)
                },
                    generalException
                );
            }

            WriteUserEvents(logixLogEvent);
        }
Esempio n. 2
0
 private void WriteUserEvents(LogixLogEvent payLoad)
 {
     _fileLogger.Log(NLog.LogLevel.Info, Newtonsoft.Json.JsonConvert.SerializeObject(payLoad));
 }
Esempio n. 3
0
 public void LogUserEvents(LogixLogEvent payLoad)
 {
     //
 }
 void ILogixLoggerService.LogEvents(LogixLogEvent payLoad)
 {
     throw new System.NotImplementedException();
 }
Esempio n. 5
0
 public void LogUserEvents(LogixLogEvent payLoad)
 {
     Gateway.LogEvents(payLoad);
 }
Esempio n. 6
0
 public void LogEvents(LogixLogEvent payLoad)
 {
     base.Gateway.LogEvents(payLoad);
 }