Use logger.error(e) instead of printStackTrace()