private void WriteDb(string message) { if (string.IsNullOrEmpty(message)) { return; } LogEntity entity = log_entity_.Clone() as LogEntity; entity.log = message; try { mongocl_.Insert(entity); } catch (Exception e) { Console.WriteLine("[Error] Can't connect MongoDb, Exception = {0}", e.Message); } }