我们有一个Pentaho作业,它在我们的本地环境中工作正常,但在部署它并使用Kettle运行作业后,我们收到写入日志文件的错误。在每个输入行都有设置'执行的作业中会发生错误?'检查。下面是如何配置日志记录设置的路径和名称是先前设置的变量。在此步骤之前,它可以正常登录文件。
作业记录配置
这是运行带有日志级别调试的Kettle时出现的错误。在失败的工作中,我们也在写日志,我不知道这是不是很糟糕的做法。有没有其他人遇到这个问题并知道解决方案?
ProcessFiles - Log folder [file:////<ServerPath>/QA/PentahoLogs] exists.
ProcessFiles - ERROR (version 6.1.0.1-196, build 1 from 2016-04-07 12.08.49 by buildguy) : Unable to open file appender for file [${LOGFOLDER}${LOGFILENAME}_20161005.txt] : org.pentaho.di.core.exception.KettleException:
ProcessFiles - There was an error while trying to open file 'file:////<ServerPath>/QA/PentahoLogs/PartImportLog_20161005.txt' for writing
ProcessFiles - Could not write to "file:////<ServerPath>/QA/PentahoLogs/PartImportLog_20161005.txt" because it is currently in use.
ProcessFiles - ERROR (version 6.1.0.1-196, build 1 from 2016-04-07 12.08.49 by buildguy) : org.pentaho.di.core.exception.KettleException:
ProcessFiles - There was an error while trying to open file 'file:////<ServerPath>/QA/PentahoLogs/PartImportLog_20161005.txt' for writing
ProcessFiles - Could not write to "file:////<ServerPath>/QA/PentahoLogs/PartImportLog_20161005.txt" because it is currently in use.
ProcessFiles -
ProcessFiles - at org.pentaho.di.core.logging.LogChannelFileWriter.<init>(LogChannelFileWriter.java:78)
ProcessFiles - at org.pentaho.di.core.logging.LogChannelFileWriter.<init>(LogChannelFileWriter.java:96)
ProcessFiles - at org.pentaho.di.job.entries.job.JobEntryJob.execute(JobEntryJob.java:552)
ProcessFiles - at org.pentaho.di.job.Job.execute(Job.java:723)
ProcessFiles - at org.pentaho.di.job.Job.execute(Job.java:864)
ProcessFiles - at org.pentaho.di.job.Job.execute(Job.java:864)
ProcessFiles - at org.pentaho.di.job.Job.execute(Job.java:864)
ProcessFiles - at org.pentaho.di.job.Job.execute(Job.java:545)
ProcessFiles - at org.pentaho.di.job.Job.run(Job.java:435)
ProcessFiles - Caused by: org.apache.commons.vfs2.FileSystemException: Could not write to "file:////<ServerPath>/QA/PentahoLogs/PartImportLog_20161005.txt" because it is currently in use.
ProcessFiles - at org.apache.commons.vfs2.provider.DefaultFileContent.getOutputStream(DefaultFileContent.java:475)
ProcessFiles - at org.pentaho.di.core.vfs.KettleVFS.getOutputStream(KettleVFS.java:289)
ProcessFiles - at org.pentaho.di.core.logging.LogChannelFileWriter.<init>(LogChannelFileWriter.java:76)
ProcessFiles - ... 8 more
答案 0 :(得分:1)
阅读日志:
ProcessFiles - 无法写入&#34; file://///QA/PentahoLogs/PartImportLog_20161005.txt"因为它目前正在使用中。
所以这意味着其他进程正在锁定txt文件。
答案 1 :(得分:1)
确保日志路径/文件未被同一存储库用户或其他用户中的其他作业使用。