Avoid 'unnecessary' construction of (multiple) String objects.

- when log4j logging level is not set to TRACE or DEBUG.

E.g.: For this Java log4j call:

LOG.trace("Enter foo var1: " + var1 + " var2: " + var2);

Let's say that the log4j logging level is set to ERROR.
The above code will construct multiple String objects
and append operations on them to create a String object that
is then passed to the 'trace()' method where it will
check whether the log level is not TRACE and simply return.
So, we spent a lot of cycles for nothing. The following
changes will help circumvent that.

Thanks to Selva for this suggestion.

Changes:

a)
LOG.trace(...

to

if (LOG.isTraceEnabled()) LOG.trace(....

b)
LOG.debug(...

to

if (LOG.isDebugEnabled()) LOG.debug(....

Change-Id: I111a6cdd7e88bdcf070c9ad52956b15e65c3cdb4