Replace printStackTrace() by logger.error()