日志的定义
//定义日志
//定义变量
VariableSpace space = new Variables();
//将日志数据库配置名加入到变量集中
space.setVariable("transloging",resource.get(2).getResource_name());
space.initializeVariablesFrom(null);
//定义Step日志
//声明StepLogTable。space:系统变量;tanMetade:提供数据库连接
StepLogTable stepLogTable = StepLogTable.getDefault(space,transMeta);
//StepLogTable使用的数据库连接名(上面配置的变量名)。
stepLogTable.setConnectionName(resource.get(2).getResource_name());
//设置Step日志的表名
stepLogTable.setTableName("step_log");
//设置TransMeta的StepLogTable
transMeta.setStepLogTable(stepLogTable);
//定义Trans日志
//声明TransLogTable。space:系统变量;tanMetade:提供数据库连接
TransLogTable transLogTable = TransLogTable.getDefault(space,transMeta, transMeta.getSteps());
//TransLogTable使用的数据库连接名(上面配置的变量名)。
transLogTable.setConnectionName(resource.get(2).getResource_name());
//设置Trans日志的表名
transLogTable.setTableName("trans_log");
//设置TransMeta的TransLogTable
transMeta.setTransLogTable(transLogTable);
//定义日志
//定义变量
VariableSpace space = new Variables();
//将日志数据库配置名加入到变量集中
space.setVariable("jobloging",resource.get(2).getResource_name());
space.initializeVariablesFrom(null);
//定义job日志
//声明JobLogTable。space:系统变量;jobMeta:提供数据库连接
JobLogTable jobLogTable = JobLogTable.getDefault(space,jobMeta);
//JobLogTable使用的数据库连接名(上面配置的变量名)。
jobLogTable.setConnectionName(resource.get(2).getResource_name());
//设置job日志的表名
jobLogTable.setTableName("job_log");
//设置jobMeta的JobLogTable
jobMeta.setJobLogTable(jobLogTable);
//定义JobEntry日志
//声明JobEntryLogTable。space:系统变量;jobMeta:提供数据库连接
JobEntryLogTable jobEntryLogTable = JobEntryLogTable.getDefault(space,jobMeta);
//JobEntryLogTable使用的数据库连接名(上面配置的变量名)。
jobEntryLogTable.setConnectionName(resource.get(2).getResource_name());
//设置JobEntry日志的表名
jobEntryLogTable.setTableName("entry_log");
//设置jobMeta的JobEntryLogTable
jobMeta.setJobEntryLogTable(jobEntryLogTable);