예제 #1
0
        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);
        }
예제 #2
0
 internal DbLog(LogConfig _logConfig)
 {
     logConfig = _logConfig;
 }
예제 #3
0
        public Log()
        {
            LogConfig logConfig = new LogConfig();

            Initialize(logConfig);
        }
예제 #4
0
        public Log(string configFilePath)
        {
            LogConfig logConfig = LogConstants.DeserializeLogConfig(configFilePath);

            Initialize(logConfig);
        }
예제 #5
0
 public Log(LogConfig logConfig)
 {
     Initialize(logConfig);
 }