From 111666f3e4552e3b24fb88f3e911ac6d6c065194 Mon Sep 17 00:00:00 2001 From: fanfuxiaoran <495538672@qq.com> Date: Thu, 27 Mar 2014 21:07:07 +0800 Subject: [PATCH] add some log --- .../org/bench4q/master/domain/service/TestPlanEngine.java | 3 ++- .../master/domain/service/auth/AuthenticationManager.java | 3 --- .../bench4q/master/domain/testplan/TestScriptResultSave.java | 5 +++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Bench4Q-Master/src/main/java/org/bench4q/master/domain/service/TestPlanEngine.java b/Bench4Q-Master/src/main/java/org/bench4q/master/domain/service/TestPlanEngine.java index e6f9137a..97940b42 100644 --- a/Bench4Q-Master/src/main/java/org/bench4q/master/domain/service/TestPlanEngine.java +++ b/Bench4Q-Master/src/main/java/org/bench4q/master/domain/service/TestPlanEngine.java @@ -94,7 +94,8 @@ public class TestPlanEngine implements TaskCompleteCallback, public UUID runWith(final TestPlanModel testPlanModel, User user) { ExecutorService executorService = Executors.newCachedThreadPool(); final UUID testPlanId = UUID.randomUUID(); - logger.info("name:" + testPlanModel.getName()); + logger.info("name:" + testPlanModel.getName() + " start to run"); + logger.info(testPlanId + " start to run"); if (!this.getTestPlanService().submitTestPlan(testPlanModel, user, testPlanId)) { return null; diff --git a/Bench4Q-Master/src/main/java/org/bench4q/master/domain/service/auth/AuthenticationManager.java b/Bench4Q-Master/src/main/java/org/bench4q/master/domain/service/auth/AuthenticationManager.java index 69d6d1f7..d787c4b3 100644 --- a/Bench4Q-Master/src/main/java/org/bench4q/master/domain/service/auth/AuthenticationManager.java +++ b/Bench4Q-Master/src/main/java/org/bench4q/master/domain/service/auth/AuthenticationManager.java @@ -9,7 +9,6 @@ import java.util.Date; import javax.servlet.http.HttpServletRequest; -import org.apache.log4j.Logger; import org.bench4q.master.domain.entity.User; import org.bench4q.master.domain.repository.UserRepository; import org.bench4q.master.helper.StringHelper; @@ -89,8 +88,6 @@ public class AuthenticationManager { } String hex = request.getHeader("Authorization").substring( "Bearer ".length()); - Logger.getLogger(AuthenticationManager.class).info( request.getHeader("Authorization")); - Logger.getLogger(AuthenticationManager.class).info("hex:" + hex); byte[] bytes = this.getStringHelper().convertToBytes(hex); return this.extractAccessToken(bytes); } diff --git a/Bench4Q-Master/src/main/java/org/bench4q/master/domain/testplan/TestScriptResultSave.java b/Bench4Q-Master/src/main/java/org/bench4q/master/domain/testplan/TestScriptResultSave.java index 10c9e0b8..306a9e7e 100644 --- a/Bench4Q-Master/src/main/java/org/bench4q/master/domain/testplan/TestScriptResultSave.java +++ b/Bench4Q-Master/src/main/java/org/bench4q/master/domain/testplan/TestScriptResultSave.java @@ -11,6 +11,7 @@ import org.bench4q.master.domain.entity.TestPlan; import org.bench4q.master.domain.entity.TestPlanScript; import org.bench4q.master.domain.factory.TestPlanFactory; import org.bench4q.master.domain.repository.TestPlanRepository; +import org.bench4q.master.exception.ExceptionLog; import org.bench4q.master.helper.SessionHelper; import org.bench4q.share.models.master.statistics.SampleModel; import org.hibernate.Session; @@ -61,7 +62,7 @@ public class TestScriptResultSave implements Observer { public boolean doSaveResult(UUID testPlanRunId, int scriptId, Object resultModel, Date now) { - + Session session = this.getSessionHelper().openSession(); try { TestPlan testPlan = this.getTestPlanRepository().doGetTestPlanBy( @@ -77,7 +78,7 @@ public class TestScriptResultSave implements Observer { this.getTestPlanRepository().doUpdateEntity(session, testPlan); return true; } catch (Exception e) { - logger.error(e, e.fillInStackTrace()); + logger.error(ExceptionLog.getStackTrace(e)); } finally { if (session != null) { session.close();