# Write variable value in simulation.log

**URL:** <https://community.gatling.io/t/write-variable-value-in-simulation-log/4885>\
**Category:** Gatling (Open-Source)\
**Created:** [March 27, 2019, 7:41am UTC](https://community.gatling.io/t/write-variable-value-in-simulation-log/4885 "2019-03-27T07:41:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shantanu\_Sen](https://avatars.discourse-cdn.com/v4/letter/s/46a35a/32.png) [@Shantanu\_Sen](https://community.gatling.io/u/Shantanu_Sen)\
**Post date:** [March 27, 2019, 7:41am UTC](https://community.gatling.io/t/write-variable-value-in-simulation-log/4885/1 "2019-03-27T07:41:17Z")

</div>

Hello  
I want to print an variable value in the below format in gatling simulation.log file if the same is possible please help

Modified format of simulation.log

```auto
REQUEST 1 account_movement_post 1553663401413 1553663404218 KO status.find.in(200,201,202,203,204,205,206,207,208,209,303), found 500 <Variable Value>

```

Actual format of simulation.log

```auto
REQUEST 1 account_movement_post 1553663401413 1553663404218 KO status.find.in(200,201,202,203,204,205,206,207,208,209,303), found 500

```

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [March 27, 2019, 7:46am UTC](https://community.gatling.io/t/write-variable-value-in-simulation-log/4885/2 "2019-03-27T07:46:44Z")

</div>

The simulation.log file is an internal and is only meant to be parsed by the module that generates the HTML reports.  
Format is subject to changes without further notice.

---

<div class="post-metadata">

**Author:** ![Shantanu\_Sen](https://avatars.discourse-cdn.com/v4/letter/s/46a35a/32.png) [@Shantanu\_Sen](https://community.gatling.io/u/Shantanu_Sen)\
**Post date:** [March 27, 2019, 8:16am UTC](https://community.gatling.io/t/write-variable-value-in-simulation-log/4885/3 "2019-03-27T08:16:52Z")

</div>

So it means that we cannot modify the format of the simulation.log file.  
In that case please help me how I can write the variable value in a text file.

---

<div class="post-metadata">

**Author:** ![G\_Madhana\_Mohana\_Red](https://avatars.discourse-cdn.com/v4/letter/g/b38774/32.png) [@G\_Madhana\_Mohana\_Red](https://community.gatling.io/u/G_Madhana_Mohana_Red)\
**Post date:** [March 29, 2019, 4:32am UTC](https://community.gatling.io/t/write-variable-value-in-simulation-log/4885/4 "2019-03-29T04:32:13Z")

</div>

Use below code for writing your customized data into output steam.

val writer = {  
val fos = new java.io.FileOutputStream("/gatling/bin/ErrorOutput.txt")  
new java.io.PrintWriter(fos,true)  
}
