At the moment I have connected the logger, but it looks something like this in all methods of each controller and something tells me that this is the wrong approach.
@RequestMapping(value="/list") public String getPlaceList(Model model){ List<PlaceType> placeTypeList = placeTypeService.getAllPlaceType(); List<Place> places = placeService.getAllPlaces(); logger.info("Info messages:"); logger.error("Error messages:"); model.addAttribute("placeTypesList", placeTypeList); model.addAttribute("places", places); return "placelist"; } @RequestMapping(value="/places") public String getPlaces(@RequestParam("id") String typeId, Model model) { logger.info("Info messages:"); logger.error("Error messages:"); PlaceType placeType = placeTypeService.getPlaceTypeById(Long.parseLong(typeId)); List<Place> places = new ArrayList<Place>(placeType.getPlaces()); model.addAttribute("places", places); return "placesList"; }