adding check if logger is in debug mode to avoid string concatenation of...

adding check if logger is in debug mode to avoid string concatenation of the whole response object which might get quite large.

At the moment object concatenation is done always although it's only required in debug mode.

I've been tracking CPU usage of my application and multiple times have I seen in thread dump that concatenation taking a lot of CPU where I actually don't need it (as I'm not running in debug mode)