You should not". Without him, everything will be fine. However, TRACE-level logging tends to be verbose and can take up a significant amount of processor time, even if it was not ultimately logged to a file. By placing an if check around the registration operator, you avoid this overhead.
I have seen other good quality codes do the same for registering the DEBUG and INFO level, so it is not limited to TRACE.
See the log4j format section of the manual.
source share