public static FileLogger GetLogger() { if(isCreate) return logger; else { logger = new FileLogger(); return logger; } }
public SearchHashForm(string collectionName = "HashForm", string dbName = "emdsdb", string hostIP = "localhost") { connectionString = String.Format("mongodb://{0}/?safe=true", hostIP); try { server = MongoServer.Create(connectionString); database = server.GetDatabase(dbName); collection = database.GetCollection<FormHash>(collectionName); server.Ping(); } catch { throw new Exception("Проблема подключением к монге"); } log = FileLogger.GetLogger(); }