Log stack trace if available.