public static LogConfig DeserializeLogConfig(string fileName) { LogConfig logConfig = null; if (File.Exists(fileName)) { XmlSerializer serializer = new XmlSerializer(typeof(LogConfig)); using (FileStream fs = new FileStream( fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) { logConfig = (LogConfig)serializer.Deserialize(fs); } } else { throw new Exception("log instantiation needs the correct config file"); } return(logConfig); }
internal DbLog(LogConfig _logConfig) { logConfig = _logConfig; }
public Log() { LogConfig logConfig = new LogConfig(); Initialize(logConfig); }
public Log(string configFilePath) { LogConfig logConfig = LogConstants.DeserializeLogConfig(configFilePath); Initialize(logConfig); }
public Log(LogConfig logConfig) { Initialize(logConfig); }