public void WriteDBLog() { var logger = new tdb.nlog.mysql.NLogger( "Server=127.0.0.1;Port=3306;Database=tdb.logs;Uid=root;Password=123456;Charset=utf8;Pooling=True;Allow User Variables=True;SslMode=none;", "TestAPI", CommHelper.GetLocalIP()); logger.Trace("NLogger.Ins.Trace"); logger.Debug("NLogger.Ins.Debug"); logger.Info("NLogger.Ins.Info"); logger.Warn("NLogger.Ins.Warn"); logger.Error(new Exception("抛出error"), "NLogger.Ins.Error"); logger.Fatal(new Exception("抛出fatal"), "NLogger.Ins.Fatal"); }
public string GetLocalIP() { return(CommHelper.GetLocalIP()); }