public static LogFileDoc LoadDocument() { LogFileDoc m_Doc; XmlSerializer xmlSerializer = new XmlSerializer(typeof(LogFileDoc)); FileStream fsReader = null; try { fsReader = File.OpenRead(@".//Parameter/LogFileSettingDoc.xml"); m_Doc = (LogFileDoc)xmlSerializer.Deserialize(fsReader); foreach (LogFileItem item in m_Doc.logFileList) { LogFileManager.LogFileDic.Add(item.fileName, item); } fsReader.Close(); } catch { if (fsReader != null) { fsReader.Close(); } m_Doc = new LogFileDoc(); } return(m_Doc); }
public static void InitLogFiles() { pDoc = LogFileDoc.LoadDocument(); foreach (LogFileItem item in pDoc.logFileList) { loggerDic.Add(item.fileName, LogManager.GetLogger(item.fileName)); } }