diff --git a/spring-petclinic-api-gateway/pom.xml b/spring-petclinic-api-gateway/pom.xml
index 6c63f47722f..c5af34a76d1 100644
--- a/spring-petclinic-api-gateway/pom.xml
+++ b/spring-petclinic-api-gateway/pom.xml
@@ -54,6 +54,10 @@
+
+ org.springframework.cloud
+ spring-cloud-sleuth-zipkin
+
org.springframework.cloud
spring-cloud-starter-config
diff --git a/spring-petclinic-customers-service/src/main/java/org/springframework/samples/petclinic/customers/web/OwnerResource.java b/spring-petclinic-customers-service/src/main/java/org/springframework/samples/petclinic/customers/web/OwnerResource.java
index 6fc57fb8e8b..e30b972b4cd 100644
--- a/spring-petclinic-customers-service/src/main/java/org/springframework/samples/petclinic/customers/web/OwnerResource.java
+++ b/spring-petclinic-customers-service/src/main/java/org/springframework/samples/petclinic/customers/web/OwnerResource.java
@@ -16,24 +16,16 @@
package org.springframework.samples.petclinic.customers.web;
import lombok.RequiredArgsConstructor;
-
-import java.util.List;
-
-import javax.validation.Valid;
-
+import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.samples.petclinic.customers.model.Owner;
import org.springframework.samples.petclinic.customers.model.OwnerRepository;
import org.springframework.samples.petclinic.monitoring.Monitored;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseStatus;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+import java.util.List;
/**
* @author Juergen Hoeller
@@ -45,6 +37,7 @@
@RequestMapping("/owners")
@RestController
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
+@Slf4j
class OwnerResource {
private final OwnerRepository ownerRepository;
@@ -88,6 +81,7 @@ public Owner updateOwner(@PathVariable("ownerId") int ownerId, @Valid @RequestBo
ownerModel.setCity(ownerRequest.getCity());
ownerModel.setAddress(ownerRequest.getAddress());
ownerModel.setTelephone(ownerRequest.getTelephone());
+ log.info("Saving owner {}", ownerModel);
return ownerRepository.save(ownerModel);
}
}
diff --git a/spring-petclinic-customers-service/src/main/java/org/springframework/samples/petclinic/customers/web/PetResource.java b/spring-petclinic-customers-service/src/main/java/org/springframework/samples/petclinic/customers/web/PetResource.java
index 4e213ec47a0..f1b60cb300e 100644
--- a/spring-petclinic-customers-service/src/main/java/org/springframework/samples/petclinic/customers/web/PetResource.java
+++ b/spring-petclinic-customers-service/src/main/java/org/springframework/samples/petclinic/customers/web/PetResource.java
@@ -16,24 +16,14 @@
package org.springframework.samples.petclinic.customers.web;
import lombok.RequiredArgsConstructor;
-
-import java.util.List;
-
+import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
-import org.springframework.samples.petclinic.customers.model.Owner;
-import org.springframework.samples.petclinic.customers.model.OwnerRepository;
-import org.springframework.samples.petclinic.customers.model.Pet;
-import org.springframework.samples.petclinic.customers.model.PetRepository;
-import org.springframework.samples.petclinic.customers.model.PetType;
+import org.springframework.samples.petclinic.customers.model.*;
import org.springframework.samples.petclinic.monitoring.Monitored;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.ResponseStatus;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
/**
* @author Juergen Hoeller
@@ -43,6 +33,7 @@
*/
@RestController
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
+@Slf4j
class PetResource {
private final PetRepository petRepository;
@@ -83,6 +74,7 @@ private void save(final Pet pet, final PetRequest petRequest) {
petRepository.findPetTypeById(petRequest.getTypeId())
.ifPresent(pet::setType);
+ log.info("Saving pet {}", pet);
petRepository.save(pet);
}
diff --git a/spring-petclinic-vets-service/pom.xml b/spring-petclinic-vets-service/pom.xml
index 9a753f37129..071e2ae2106 100644
--- a/spring-petclinic-vets-service/pom.xml
+++ b/spring-petclinic-vets-service/pom.xml
@@ -45,6 +45,10 @@
+
+ org.springframework.cloud
+ spring-cloud-sleuth-zipkin
+
org.springframework.cloud
spring-cloud-starter-config
diff --git a/spring-petclinic-visits-service/src/main/java/org/springframework/samples/petclinic/visits/web/VisitResource.java b/spring-petclinic-visits-service/src/main/java/org/springframework/samples/petclinic/visits/web/VisitResource.java
index 28b8850815b..82241111dbc 100644
--- a/spring-petclinic-visits-service/src/main/java/org/springframework/samples/petclinic/visits/web/VisitResource.java
+++ b/spring-petclinic-visits-service/src/main/java/org/springframework/samples/petclinic/visits/web/VisitResource.java
@@ -16,21 +16,15 @@
package org.springframework.samples.petclinic.visits.web;
import lombok.RequiredArgsConstructor;
-
-import java.util.List;
-
-import javax.validation.Valid;
-
+import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.samples.petclinic.visits.model.Visit;
import org.springframework.samples.petclinic.visits.model.VisitRepository;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.ResponseStatus;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+import java.util.List;
/**
* @author Juergen Hoeller
@@ -41,6 +35,7 @@
*/
@RestController
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
+@Slf4j
public class VisitResource {
private final VisitRepository visitRepository;
@@ -52,6 +47,7 @@ public void create(
@PathVariable("petId") int petId) {
visit.setPetId(petId);
+ log.info("Saving visit {}", visit);
visitRepository.save(visit);
}