Jean-Francois Leveque

https://tree.taiga.io/project/jr-utily-grog-v3/us/72 Mise en place de logs TRACE…

… sur mise à jour données
...@@ -6,6 +6,8 @@ import org.legrog.entities.PublisherRepository; ...@@ -6,6 +6,8 @@ import org.legrog.entities.PublisherRepository;
6 import org.legrog.entities.PublisherVersion; 6 import org.legrog.entities.PublisherVersion;
7 import org.legrog.entities.PublisherVersionRepository; 7 import org.legrog.entities.PublisherVersionRepository;
8 import org.legrog.web.xyz.SharedService; 8 import org.legrog.web.xyz.SharedService;
9 +import org.slf4j.Logger;
10 +import org.slf4j.LoggerFactory;
9 11
10 import javax.ejb.Stateless; 12 import javax.ejb.Stateless;
11 import javax.inject.Inject; 13 import javax.inject.Inject;
...@@ -21,6 +23,8 @@ import java.util.Set; ...@@ -21,6 +23,8 @@ import java.util.Set;
21 23
22 @Stateless 24 @Stateless
23 public class PublisherServiceSpring implements PublisherService { 25 public class PublisherServiceSpring implements PublisherService {
26 + Logger logger = LoggerFactory.getLogger(getClass());
27 +
24 @Inject 28 @Inject
25 PublisherRepository publisherRepository; 29 PublisherRepository publisherRepository;
26 30
...@@ -42,6 +46,7 @@ public class PublisherServiceSpring implements PublisherService { ...@@ -42,6 +46,7 @@ public class PublisherServiceSpring implements PublisherService {
42 } 46 }
43 47
44 public void addVersionToPublisher(Publisher publisher, PublisherVersion publisherVersion) { 48 public void addVersionToPublisher(Publisher publisher, PublisherVersion publisherVersion) {
49 + logger.trace("debut addVersionToPublisher, publisherVersion = {}", publisherVersion);
45 Set<PublisherVersion> publisherVersionSet = publisher.getVersions(); 50 Set<PublisherVersion> publisherVersionSet = publisher.getVersions();
46 publisherVersionSet.add(publisherVersion); 51 publisherVersionSet.add(publisherVersion);
47 publisher.setVersions(publisherVersionSet); 52 publisher.setVersions(publisherVersionSet);
...@@ -50,6 +55,7 @@ public class PublisherServiceSpring implements PublisherService { ...@@ -50,6 +55,7 @@ public class PublisherServiceSpring implements PublisherService {
50 publisherVersion.setPublisherVersionDatetime(new Timestamp(new Date().getTime())); 55 publisherVersion.setPublisherVersionDatetime(new Timestamp(new Date().getTime()));
51 this.savePublisherVersion(publisherVersion); 56 this.savePublisherVersion(publisherVersion);
52 this.savePublisher(publisher); 57 this.savePublisher(publisher);
58 + logger.trace("fin addVersionToPublisher, publisherVersion = {}", publisherVersion);
53 } 59 }
54 60
55 public void validatePublisherVersion(Publisher publisher, Integer publisherVersionId) { 61 public void validatePublisherVersion(Publisher publisher, Integer publisherVersionId) {
......
...@@ -119,9 +119,15 @@ public class PublisherVersionView implements Serializable { ...@@ -119,9 +119,15 @@ public class PublisherVersionView implements Serializable {
119 } 119 }
120 120
121 public void update() { 121 public void update() {
122 + logger.trace("debut update, attributs locaux, publisherActive = {} publisherAddressCountry = {} publisherAddressLocality = {} publisherAddressRegion = {} publisherEmail = {} publisherHistory = {} publisherName = {} publisherPostalCode = {} publisherPostOfficeBoxNumber = {} publisherStreetAddress = {} publisherTelephone {} publisherURL {}",
123 + publisherActive, publisherAddressCountry, publisherAddressLocality, publisherAddressRegion,
124 + publisherEmail, publisherHistory, publisherName, publisherPostalCode, publisherPostOfficeBoxNumber,
125 + publisherStreetAddress, publisherTelephone, publisherURL);
126 +
122 PublisherVersion publisherVersion = new PublisherVersion(); 127 PublisherVersion publisherVersion = new PublisherVersion();
123 setValues(publisherVersion); 128 setValues(publisherVersion);
124 129
130 + logger.trace("milieu update, avant enregistrement, publisherVersion = {}", publisherVersion);
125 publisherService.addVersionToPublisher(publisher, publisherVersion); 131 publisherService.addVersionToPublisher(publisher, publisherVersion);
126 132
127 publisherVersionId = publisherVersion.getPublisherVersionId(); 133 publisherVersionId = publisherVersion.getPublisherVersionId();
...@@ -129,6 +135,7 @@ public class PublisherVersionView implements Serializable { ...@@ -129,6 +135,7 @@ public class PublisherVersionView implements Serializable {
129 getImmutableValues(); 135 getImmutableValues();
130 136
131 editMode = false; 137 editMode = false;
138 + logger.trace("fin update, après récupération, publisherVersion = {}", publisherVersion);
132 } 139 }
133 140
134 public void loadData() { 141 public void loadData() {
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
8 </appender> 8 </appender>
9 9
10 <logger name="org.legrog" level="DEBUG"/> 10 <logger name="org.legrog" level="DEBUG"/>
11 + <logger name="org.legrog.web.publisher" level="TRACE"/>
11 12
12 <root level="warn"> 13 <root level="warn">
13 <appender-ref ref="STDOUT" /> 14 <appender-ref ref="STDOUT" />
......