mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-15 18:12:35 +01:00
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
This commit is contained in:
parent
a1ca7e09ca
commit
a4521551a3
@ -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();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user