bug 9827:AssertionError: Resource counts can not be negative
adding extra logging for resource count issues
diff --git a/server/src/com/cloud/user/AccountManagerImpl.java b/server/src/com/cloud/user/AccountManagerImpl.java
index 03e7931..d5e524d 100755
--- a/server/src/com/cloud/user/AccountManagerImpl.java
+++ b/server/src/com/cloud/user/AccountManagerImpl.java
@@ -232,6 +232,11 @@
 
         if (m_resourceCountLock.lock(120)) { // 2 minutes
             try {
+
+                if (s_logger.isDebugEnabled()) {
+                    s_logger.debug("Incrementing the ResourceType." + type.toString() + " count for the account:" + accountId + " by " + numToIncrement);
+                }
+                
                 _resourceCountDao.updateAccountCount(accountId, type, true, numToIncrement);
 
                 // on a per-domain basis, increment the count
@@ -255,6 +260,11 @@
 
         if (m_resourceCountLock.lock(120)) { // 2 minutes
             try {
+
+                if (s_logger.isDebugEnabled()) {
+                    s_logger.debug("Decrementing the ResourceType." + type.toString() + " count for the account:" + accountId + " by " + numToDecrement);
+                }
+
                 assert ((_resourceCountDao.getAccountCount(accountId, type) - numToDecrement) >= 0) : "Resource counts can not be negative. Check where we skipped increment.";
                 _resourceCountDao.updateAccountCount(accountId, type, false, numToDecrement);