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); } }
public static void InitConfiguration() { var config = new LogConfiguration(); JsonConverter.SerializeToFile(config, ConfigFilePath); }