Added support for logging all the inner exceptions of an exception when trying to log it.