You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by al...@apache.org on 2012/08/02 04:08:32 UTC
[21/44] git commit: Do not log null lines in agent logfile
Do not log null lines in agent logfile
Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/88b317f7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/88b317f7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/88b317f7
Branch: refs/heads/vpc
Commit: 88b317f7fdb86cf0cb6b8e1e78b56bc6541265fe
Parents: ef9dd42
Author: Edison Su <su...@gmail.com>
Authored: Wed Aug 1 15:26:26 2012 -0700
Committer: Edison Su <su...@gmail.com>
Committed: Wed Aug 1 15:26:41 2012 -0700
----------------------------------------------------------------------
agent/src/com/cloud/agent/Agent.java | 25 +++++++++++--------------
1 files changed, 11 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/88b317f7/agent/src/com/cloud/agent/Agent.java
----------------------------------------------------------------------
diff --git a/agent/src/com/cloud/agent/Agent.java b/agent/src/com/cloud/agent/Agent.java
index babf0b3..6db97aa 100755
--- a/agent/src/com/cloud/agent/Agent.java
+++ b/agent/src/com/cloud/agent/Agent.java
@@ -466,20 +466,17 @@ public class Agent implements HandlerFactory, IAgentControl {
final Command cmd = cmds[i];
Answer answer;
try {
- if (s_logger.isDebugEnabled()) {
- // this is a hack to make sure we do NOT log the ssh keys
- if ((cmd instanceof ModifySshKeysCommand)) {
- s_logger.debug("Received the request for command: ModifySshKeysCommand");
- } else {
- if (!requestLogged) // ensures request is logged only once per method call
- {
- s_logger.debug("Request:" + request.toString());
- requestLogged = true;
- }
- }
-
- s_logger.debug("Processing command: " + cmd.toString());
- }
+ if (s_logger.isDebugEnabled()) {
+ if (!requestLogged) // ensures request is logged only once per method call
+ {
+ String requestMsg = request.toString();
+ if (requestMsg != null) {
+ s_logger.debug("Request:" + requestMsg);
+ }
+ requestLogged = true;
+ }
+ s_logger.debug("Processing command: " + cmd.toString());
+ }
if (cmd instanceof CronCommand) {
final CronCommand watch = (CronCommand) cmd;