Beispiel #1
0
        public static void AddProcessLogIntegration(string _msg)
        {
            try
            {
                if (IsFileCreated == false)
                {
                    IsFileCreated = true;
                    string _folderName = Directory.GetCurrentDirectory() + "\\IntegrationLog";
                    string prefex      = "IntegrationLog_";
                    TwTwSystemLogs.SetLogFile(logDir: _folderName, prefix: prefex, extension: "txt", writeText: true);
                }
                TwTwSystemLogs.Info(_msg);
            }
            catch (Exception ex)
            {
                TwTwSystemLogs.Error("Error : " + ex.Message);
            }
            //try
            //{
            //    string _folderName = Directory.GetCurrentDirectory() + "\\IntegrationLog";
            //    if (!Directory.Exists(_folderName))
            //        Directory.CreateDirectory(_folderName);

            //    string _fileName = _folderName + "\\IntegrationLog_" + DateTime.Now.ToString("yyyyMMdd") + ".txt";

            //    if (!File.Exists(_fileName))
            //    {
            //        using (StreamWriter sw = File.CreateText(_fileName))
            //        {
            //            sw.WriteLine(DateTime.Now.ToString() + "  " + _msg);
            //            sw.Close();
            //        }
            //    }
            //    else
            //    {
            //        using (StreamWriter sw = File.AppendText(_fileName))
            //        {
            //            sw.WriteLine(DateTime.Now.ToString() + "  " + _msg);
            //            sw.Close();

            //        }
            //    }
            //}
            //catch (Exception ex)
            //{

            //}
        }
 public static void AddProcessLogFFTAdapterOperation(string _msg)
 {
     try
     {
         if (IsFileCreated == false)
         {
             IsFileCreated = true;
             string _folderName = Directory.GetCurrentDirectory() + "\\FFTAdapterOperationLogs";
             string prefex      = "FFTAdapterOperationLog_";
             TwTwSystemLogs.SetLogFile(logDir: _folderName, prefix: prefex, extension: "txt", writeText: true);
         }
         TwTwSystemLogs.Info(_msg);
     }
     catch (Exception ex)
     {
         TwTwSystemLogs.Error("Error : " + ex.Message);
     }
 }
 public static void AddProcessLog(string _msg)
 {
     try
     {
         var IsLogEnable = Storage.IsLogEnable;    //
         if (_msg.ToLower().Contains("exception")) //
         {
             if (IsFileCreated == false)
             {
                 IsFileCreated = true;
                 string _folderName = Directory.GetCurrentDirectory() + "\\WatchDogLogs";
                 string prefex      = "WatchDogLog_";
                 TwTwSystemLogs.SetLogFile(logDir: _folderName, prefix: prefex, extension: "txt", writeText: true);
             }
             TwTwSystemLogs.Info(_msg);
         }
         else
         {
             if (IsLogEnable == "1")//komal 13082018 for  it is enable & disable logs in log file .
             {
                 if (IsFileCreated == false)
                 {
                     IsFileCreated = true;
                     string _folderName = Directory.GetCurrentDirectory() + "\\WatchDogLogs";
                     string prefex      = "WatchDogLog_";
                     TwTwSystemLogs.SetLogFile(logDir: _folderName, prefix: prefex, extension: "txt", writeText: true);
                 }
                 TwTwSystemLogs.Info(_msg);
             }
         }
     }
     catch (Exception ex)
     {
         TwTwSystemLogs.Error("Error : " + ex.Message);
     }
 }