Logs an error from an exception using its message
Check isTraceEnabled flag before logging to save some memory allocations.
isTraceEnabled