public void Test()
        {
            {
                UserActionOptLogConfig config = UserActionOptLogConfig.GetUserActionOptLogConfig();

                config.ConnectionType   = "System.Data.SqlClient.SqlConnection, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
                config.ConnectionString = "Data Source=.;Initial Catalog=SWERP_ORDER;User ID=sa;Password=sa@2008;";
                config.CommandText      = @"INSERT INTO [SWERP_ORDERSYS_ERRORLOG]([Date],[Thread],[Level],[Logger],[Message],[Exception]) 
VALUES (@log_date, @thread, @log_level, @logger, @message, @exception)";

                config.Parameters.Add("@log_date", "log_date");
                config.Parameters.Add("@thread", "thread");
                config.Parameters.Add("@log_level", "log_level");
                config.Parameters.Add("@logger", "logger");
                config.Parameters.Add("@message", "message");
                config.Parameters.Add("@exception", "exception");
                config.Parameters.Add(new UserActionOptLogParameterElement("Parametertest3", "Parametervalue4")
                {
                    ParameterType = typeof(DateTime).FullName, Format = "yyyy-mm-dd hh:MM:ss"
                });

                config.Save();
            }
            {
                var config = UserActionOptLogConfig.GetUserActionOptLogConfig();

                Console.WriteLine($"连接类型: {config.ConnectionType}");
                Console.WriteLine($"连接配置字符串: {config.ConnectionString}");
                Console.WriteLine($"执行SQL: {config.CommandText}");
                foreach (UserActionOptLogParameterElement item in config.Parameters)
                {
                    Console.WriteLine($"参数名:{item.ParameterName};参数类型:{item.ParameterType};参数值:{item.ParameterValue};格式:{item.Format}");
                }
            }
        }
        public static UserActionOptLogConfig GetUserActionOptLogConfig()
        {
            Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);

            object obj = config.Sections[sectionName];
            UserActionOptLogConfig section = null;

            if (obj == null)
            {
                section = new UserActionOptLogConfig(config);
                config.Sections.Add(sectionName, section);
            }
            else
            {
                section = obj as UserActionOptLogConfig;
            }
            return(section);
        }