[ofbiz-framework] branch trunk updated: Improved: Improve logging for services run on global-commit/global-rollback (OFBIZ-11667)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ofbiz-framework] branch trunk updated: Improved: Improve logging for services run on global-commit/global-rollback (OFBIZ-11667)

Pawan Verma-2
This is an automated email from the ASF dual-hosted git repository.

pawan pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new de07647  Improved: Improve logging for services run on global-commit/global-rollback (OFBIZ-11667)
de07647 is described below

commit de07647bfe3b22f94f60e535cc6835af8be859e2
Author: Pawan Verma <[hidden email]>
AuthorDate: Sun May 10 14:06:38 2020 +0530

    Improved: Improve logging for services run on global-commit/global-rollback
    (OFBIZ-11667)
   
    Thanks: Jacques and Suraj for the review.
---
 .../java/org/apache/ofbiz/service/ServiceSynchronization.java    | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/ServiceSynchronization.java b/framework/service/src/main/java/org/apache/ofbiz/service/ServiceSynchronization.java
index 484cb46..47f6c6b 100644
--- a/framework/service/src/main/java/org/apache/ofbiz/service/ServiceSynchronization.java
+++ b/framework/service/src/main/java/org/apache/ofbiz/service/ServiceSynchronization.java
@@ -80,9 +80,18 @@ public class ServiceSynchronization implements Synchronization {
 
     @Override
     public void afterCompletion(int status) {
+        long start = System.currentTimeMillis();
+        if (Debug.verboseOn())
+            Debug.logVerbose("Running " + this.services.size() + " services on commit/rollback", MODULE);
         for (ServiceExecution serviceExec : this.services) {
             serviceExec.runService(status);
+            if (Debug.verboseOn())
+                Debug.logVerbose("Completed service [" + serviceExec.serviceName + "] async [" + serviceExec.async
+                        + "] persisted [" + serviceExec.persist + "]", MODULE);
         }
+        if (Debug.verboseOn())
+            Debug.logVerbose("Commit/rollback services complete in "
+                                            + (System.currentTimeMillis() - start) + "ms", MODULE);
     }
 
     @Override