Beispiel #1
0
 public static void WriteToLog(string message, string module, ActivityLogTypes logType, string logFileName)
 {
     ReadWriteLock.EnterWriteLock();
     try
     {
         if (logFileName != null)
         {
             var item = new ActivityItem
             {
                 Club         = ConfigurationManager.AppSettings["OrganisationName"],
                 Datum        = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                 Ip           = ConfigurationManager.AppSettings["Ip"],
                 Source       = "Photomanager.UI",
                 Type         = logType.ToString(),
                 Lokatie      = module,
                 Omschrijving = message
             };
             XmlFactory.AddToXml(FolderFactory.LogFolder, logFileName, item);
         }
     }
     finally
     {
         ReadWriteLock.ExitWriteLock();
     }
 }
Beispiel #2
0
 public static void WriteToLog <T>(T item, string logFileName)
 {
     ReadWriteLock.EnterWriteLock();
     try
     {
         if (logFileName != null)
         {
             XmlFactory.AddToXml(FolderFactory.LogFolder, logFileName, item);
         }
     }
     finally
     {
         ReadWriteLock.ExitWriteLock();
     }
 }