# Strange behavior when logging is off in Gatling 2.1.7

**URL:** <https://community.gatling.io/t/strange-behavior-when-logging-is-off-in-gatling-2-1-7/2446>\
**Category:** Gatling (Open-Source)\
**Created:** [August 7, 2015, 6:52am UTC](https://community.gatling.io/t/strange-behavior-when-logging-is-off-in-gatling-2-1-7/2446 "2015-08-07T06:52:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![E\_Ulrich\_Kriegel](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@E\_Ulrich\_Kriegel](https://community.gatling.io/u/E_Ulrich_Kriegel)\
**Post date:** [August 7, 2015, 6:52am UTC](https://community.gatling.io/t/strange-behavior-when-logging-is-off-in-gatling-2-1-7/2446/1 "2015-08-07T06:52:30Z")

</div>

Hi there,  
during the development of my stress tests logging was set to on and everything worked well. Trying to run the tests with logging off, i get errors.  
I tried again with logging off → no errors, logging on → errors.

I finally identified the cause: a type conversion error

replacing

val incidentMap = session(“incidentMap”).as[Map[String, Any]]  
val listBuffer = new scala.collection.mutable.ListBufferString  
for (entry ← incidentMap.get(“alerts”).get.asInstanceOf[org.boon.core.value.ValueList].list()) {  
listBuffer += entry.asInstanceOf[String]  
}

with

val incidentMap = session(“incidentMap”).as[Map[String, Any]]

val listBuffer = new scala.collection.mutable.ListBufferString

for (entry ← incidentMap.get(“alerts”).get.asInstanceOf[org.boon.core.value.ValueList].list()) {

listBuffer += (entry.toString)

}

the error is gone. But why does the error occur only with logging off

---

<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:** [August 7, 2015, 4:50pm UTC](https://community.gatling.io/t/strange-behavior-when-logging-is-off-in-gatling-2-1-7/2446/2 "2015-08-07T16:50:04Z")

</div>

We use Boon’s lazy loading Maps, so there’s a chance you’re displaying them in some way in debug logging level, forcing them to load.

---

<div class="post-metadata">

**Author:** ![E\_Ulrich\_Kriegel](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@E\_Ulrich\_Kriegel](https://community.gatling.io/u/E_Ulrich_Kriegel)\
**Post date:** [August 12, 2015, 5:52am UTC](https://community.gatling.io/t/strange-behavior-when-logging-is-off-in-gatling-2-1-7/2446/3 "2015-08-12T05:52:44Z")

</div>

Hello Stéphane,  
the technical problem is already solved. What scares me is, that Gatling shows a different behavior in dependence of logging on or off.

– Ulrich

---

<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:** [August 12, 2015, 6:35am UTC](https://community.gatling.io/t/strange-behavior-when-logging-is-off-in-gatling-2-1-7/2446/4 "2015-08-12T06:35:35Z")

</div>

I would love a reproducer.  
I really suspect you’re scanning the JSON tree an additional first time when debugging.  
I wonder if we should deep copy branches when using ofType.
