Query log

add log message with query error and exception traceback (very useful when debugging)