LPS-41302 add in condition for handling nosuchlayoutexceptions to log th...

...e stack trace when log level is enabled