标签:div client and add cti int long stack new
var config = new NLog.Config.LoggingConfiguration( );
var logfile = new NLog.Targets.DatabaseTarget( ) { };
logfile.CommandText = "insert into MyLog ([CreateDate], [Origin], [LogLevel], [Message], [StackTrace]) values (@createDate, @origin, @logLevel, @message, @stackTrace);";
logfile.CommandType = System.Data.CommandType.Text;
logfile.ConnectionString = "";
logfile.Name="dblog";
logfile.Parameters.Add( new DatabaseParameterInfo( "@createDate", "${longdate}" ) );
logfile.DBProvider = "MySql.Data.MySqlClient";//System.Data.SqlClient
config.LoggingRules.Add( new NLog.Config.LoggingRule( "*", NLog.LogLevel.Debug, logfile ) );
标签:div client and add cti int long stack new
原文地址:https://www.cnblogs.com/YorkQi/p/13816021.html