# How to generate a separate log file for each test?

**URL:** <https://forum.robotframework.org/t/how-to-generate-a-separate-log-file-for-each-test/8934>\
**Category:** Robot Framework\
**Created:** [5 June 2025 04:44 UTC](https://forum.robotframework.org/t/how-to-generate-a-separate-log-file-for-each-test/8934 "2025-06-05T04:44:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ShubhamST](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@ShubhamST](https://forum.robotframework.org/u/ShubhamST)\
**Post date:** [5 June 2025 04:44 UTC](https://forum.robotframework.org/t/how-to-generate-a-separate-log-file-for-each-test/8934/1 "2025-06-05T04:44:32Z")

</div>

My test framework has following flow:

CSV File (Each row contains parameters a different test scenario)  
|-\> The .robot file uses datadriver Library to parse the CSV  
|-\> The robot file contains the test flow and invokes related python code using keywords

The robot file is run and all the test scenario defined in CSV get executed w.r.t to parameters defined in each row.  
At the end of test suite we get a output.xml, log.html, report.html

The logs and reports contain consolidated data of the test suite.  
But I would like to generate a separate log and report file for each test scenario defined in the CSV.

How this can be achieved?

Please note: I do not want to create multiple robot files for each test case

---

<div class="post-metadata">

**Author:** ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)\
**Post date:** [5 June 2025 06:40 UTC](https://forum.robotframework.org/t/how-to-generate-a-separate-log-file-for-each-test/8934/2 "2025-06-05T06:40:11Z")

</div>

Hi Shubham,

after running the test and getting the output.xml, you could try using `rebot` with the `-t` option, something like:

```python
rebot -t "your test name" -o "your test name output.xml" output.xml

```

If that does what you need then repeat for each test you want as a separate file. You can direct these outputs to different directories etc, see the `rebot` help for more options.

Dave.
