don't create message if log is disabled, concat stacktrace only when exception is given, ensure close streams