kettle日志输出到数据库,LINES_READ,LINES_WRITTEN,LINES_UPDATE等字段为0的设置

最近项目中用到kettle,一直在研究kettle日志方面,今天遇到的问题是kettle执行转换后输出日志到数据库,LINES_READ,LINES_WRITTEN,LINES_UPDATE等字段为0,网上查了很多资料说是需要设置步骤,搜了半天也没有搜到,在一个博客的评论下面找到了方法,记录一下,在相关字段后面设置对应步骤,就ok了

kettle日志输出到数据库,LINES_READ,LINES_WRITTEN,LINES_UPDATE等字段为0的设置

kettle日志输出到数据库,LINES_READ,LINES_WRITTEN,LINES_UPDATE等字段为0的设置 附上Java代码的设置

        VariableSpace space = new Variables();  
        //将step日志数据库配置名加入到变量集中  
        space.setVariable("kettle_log","database");
        space.initializeVariablesFrom(null);  

        //定义Trans日志
           //声明TransLogTable。space:系统变量;tanMetade:提供数据库连接
          TransLogTable transLogTable = TransLogTable.getDefault(space,transMeta, transMeta.getSteps());
           //TransLogTable使用的数据库连接名(上面配置的变量名)。
           transLogTable.setConnectionName("database");
           //设置Trans日志的表名
           transLogTable.setTableName("kettle_log"));
           
           transLogTable.setStepRead(步骤); //读行数
           transLogTable.setStepWritten(步骤);  //设置写行数
//           transLogTable.setStepUpdate(步骤);//更新行数
           transLogTable.setStepInput(步骤);
           transLogTable.setStepOutput(tostep);

         //设置TransMeta的TransLogTable
           transMeta.setTransLogTable(transLogTable);