Replaced all "ex.printStackTrace()" with "logger.error"