Return-Path: X-Original-To: apmail-incubator-cloudstack-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-cloudstack-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 25C65EB21 for ; Mon, 18 Mar 2013 10:15:04 +0000 (UTC) Received: (qmail 66283 invoked by uid 500); 18 Mar 2013 10:14:56 -0000 Delivered-To: apmail-incubator-cloudstack-commits-archive@incubator.apache.org Received: (qmail 65894 invoked by uid 500); 18 Mar 2013 10:14:55 -0000 Mailing-List: contact cloudstack-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cloudstack-dev@incubator.apache.org Delivered-To: mailing list cloudstack-commits@incubator.apache.org Received: (qmail 62314 invoked by uid 99); 18 Mar 2013 10:14:50 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Mar 2013 10:14:50 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 2666635BC5; Mon, 18 Mar 2013 10:14:50 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: muralireddy@apache.org To: cloudstack-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [1/50] [abbrv] git commit: refs/heads/gslb-wip - agent: Log4j should not be initialized in the main method Message-Id: <20130318101450.2666635BC5@tyr.zones.apache.org> Date: Mon, 18 Mar 2013 10:14:50 +0000 (UTC) agent: Log4j should not be initialized in the main method Since we use JSVC we don't execute the main method, but it is still there for manually running the Agent. Initializing log4j in the start method makes sure it also works with JSVC Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/a4521551 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/a4521551 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/a4521551 Branch: refs/heads/gslb-wip Commit: a4521551a35cadd19a95752d3d93af8c2a9edd5b Parents: a1ca7e0 Author: Wido den Hollander Authored: Wed Mar 6 16:41:39 2013 +0100 Committer: Wido den Hollander Committed: Wed Mar 6 16:42:38 2013 +0100 ---------------------------------------------------------------------- agent/src/com/cloud/agent/AgentShell.java | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a4521551/agent/src/com/cloud/agent/AgentShell.java ---------------------------------------------------------------------- diff --git a/agent/src/com/cloud/agent/AgentShell.java b/agent/src/com/cloud/agent/AgentShell.java index 7297ab2..9cb3c3d 100644 --- a/agent/src/com/cloud/agent/AgentShell.java +++ b/agent/src/com/cloud/agent/AgentShell.java @@ -553,6 +553,9 @@ public class AgentShell implements IAgentShell { public void start() { try { + /* By default we only search for log4j.xml */ + LogUtils.initLog4j("log4j-cloud.xml"); + System.setProperty("java.net.preferIPv4Stack", "true"); String instance = getProperty(null, "instance"); @@ -612,8 +615,6 @@ public class AgentShell implements IAgentShell { public static void main(String[] args) { try { - LogUtils.initLog4j("log4j-cloud.xml"); - AgentShell shell = new AgentShell(); shell.init(args); shell.start();