We have a Pentaho job which is working fine in our local environment but we get an error writing to the log file after deploying it and running the job using Kettle. The error occurs in a job which has the setting 'Execute for every input row?' checked. Below is how the logging settings is configured the path and names are variables which are being set earlier. It is able to log to the file fine before this step.

Job Logging Configuration

[![enter image description here](https://i.stack.imgur.com/gTX31.jpg)](https://i.stack.imgur.com/gTX31.jpg)

This is error I get when running Kettle with log level of debug. Inside of the failing job we are also writing to the log which I don't know if that is a bad practice. Has anyone else come across this issue and know a resolution?

```
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

```