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) {
......
...@@ -118,9 +118,15 @@ public class PublisherVersionView implements Serializable { ...@@ -118,9 +118,15 @@ public class PublisherVersionView implements Serializable {
118 } 118 }
119 119
120 public void update() { 120 public void update() {
121 + logger.trace("debut update, attributs locaux, publisherActive = {} publisherAddressCountry = {} publisherAddressLocality = {} publisherAddressRegion = {} publisherEmail = {} publisherHistory = {} publisherName = {} publisherPostalCode = {} publisherPostOfficeBoxNumber = {} publisherStreetAddress = {} publisherTelephone {} publisherURL {}",
122 + publisherActive, publisherAddressCountry, publisherAddressLocality, publisherAddressRegion,
123 + publisherEmail, publisherHistory, publisherName, publisherPostalCode, publisherPostOfficeBoxNumber,
124 + publisherStreetAddress, publisherTelephone, publisherURL);
125 +
121 PublisherVersion publisherVersion = new PublisherVersion(); 126 PublisherVersion publisherVersion = new PublisherVersion();
122 setValues(publisherVersion); 127 setValues(publisherVersion);
123 128
129 + logger.trace("milieu update, avant enregistrement, publisherVersion = {}", publisherVersion);
124 publisherService.addVersionToPublisher(publisher, publisherVersion); 130 publisherService.addVersionToPublisher(publisher, publisherVersion);
125 131
126 publisherVersionId = publisherVersion.getPublisherVersionId(); 132 publisherVersionId = publisherVersion.getPublisherVersionId();
...@@ -128,6 +134,7 @@ public class PublisherVersionView implements Serializable { ...@@ -128,6 +134,7 @@ public class PublisherVersionView implements Serializable {
128 getImmutableValues(); 134 getImmutableValues();
129 135
130 editMode = false; 136 editMode = false;
137 + logger.trace("fin update, après récupération, publisherVersion = {}", publisherVersion);
131 } 138 }
132 139
133 public void loadData() { 140 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" />
......