Log4net ADONetAppender - 查看参数值?

时间:2016-10-10 22:10:53

标签: c# log4net adonetappender

调试log4net时是否可以查看AdoNetAppenderParameter值?

若然,怎么样?

谢谢!

1 个答案:

答案 0 :(得分:0)

https://github.com/apache/log4net的源代码中,您会找到AdoNetAppender.cs文件:

virtual public void Prepare(IDbCommand command)分配参数:

IDbDataParameter param = command.CreateParameter();

// Set the parameter properties
param.ParameterName = ParameterName;

    if (!m_inferType)
    {
        param.DbType = DbType;
    }
    if (Precision != 0)
    {
        param.Precision = Precision;
    }
    if (Scale != 0)
    {
        param.Scale = Scale;
    }
    if (Size != 0)
    {
        param.Size = Size;
    }

    // Add the parameter to the collection of params
    command.Parameters.Add(param);

调试时,可以检查参数对象。