Mike Kolesnik has uploaded a new change for review.

Change subject: engine: Change queries error logging to use @Logged
......................................................................

engine: Change queries error logging to use @Logged

Currently all VDS commands use the @Logged annotation mechanism to
specify logging of the command.
Queries use this for entry/return logging but not for error logging -
so changed the error logging of queries to use this mechanism.

This should have no effect on the amount of logs since we'll be logging
at error level as was done before, but now each query can specify it's
own behavior.

Change-Id: Ia88cb94d7c8e4195c81e156d1422c9f7cb99eb8a
Signed-off-by: Mike Kolesnik <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/QueriesCommandBase.java
1 file changed, 4 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/20/17320/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/QueriesCommandBase.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/QueriesCommandBase.java
index cc8d817..16a6484 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/QueriesCommandBase.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/QueriesCommandBase.java
@@ -20,8 +20,9 @@
 import org.ovirt.engine.core.dao.VdsDAO;
 import org.ovirt.engine.core.utils.log.Logged;
 import org.ovirt.engine.core.utils.log.Logged.LogLevel;
+import org.ovirt.engine.core.utils.log.LoggedUtils;
 
-@Logged(executionLevel = LogLevel.TRACE, errorLevel = LogLevel.WARN)
+@Logged(executionLevel = LogLevel.TRACE, errorLevel = LogLevel.ERROR)
 public abstract class QueriesCommandBase<P extends VdcQueryParametersBase> 
extends VdcCommandBase {
 
     private final static Validator validator = 
Validation.buildDefaultValidatorFactory().getValidator();
@@ -73,20 +74,10 @@
                         } else {
                             
returnValue.setExceptionString(vdcExc.getMessage());
                         }
-                        log.errorFormat("Query {0} failed. Exception message 
is {1}",
-                                getClass().getSimpleName(),
-                                vdcExc.getMessage());
-                        if (log.isDebugEnabled()) {
-                            log.debugFormat("Detailed stacktrace:", vdcExc);
-                        }
+                        LoggedUtils.logError(log, 
LoggedUtils.getObjectId(this), this, vdcExc);
                     } else {
                         returnValue.setExceptionString(ex.getMessage());
-                        log.errorFormat("Query {0} failed. Exception message 
is {1}",
-                                getClass().getSimpleName(),
-                                ex.getMessage());
-                        if (log.isDebugEnabled()) {
-                            log.debugFormat("Detailed stacktrace:", ex);
-                        }
+                        LoggedUtils.logError(log, 
LoggedUtils.getObjectId(this), this, ex);
                     }
                 }
             } else {


-- 
To view, visit http://gerrit.ovirt.org/17320
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia88cb94d7c8e4195c81e156d1422c9f7cb99eb8a
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Mike Kolesnik <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to