Beispiel #1
0
        public static LogConfiguration GetLogConfig()
        {
            if (!File.Exists(ConfigFilePath))
            {
                InitConfiguration();
                return(new LogConfiguration());
            }
            else
            {
                LogConfiguration config = new LogConfiguration();
                try
                {
                    config = JsonConverter.DeserializeFromFile <LogConfiguration>(ConfigFilePath);
                }
                catch (Exception ex)
                {
                    throw ex;
                }

                return(config);
            }
        }
Beispiel #2
0
        public static void InitConfiguration()
        {
            var config = new LogConfiguration();

            JsonConverter.SerializeToFile(config, ConfigFilePath);
        }