cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] DaanHoogland closed pull request #2276: WIP: CLOUDSTACK-10089 log4j update to version 2
Date Thu, 01 Jan 1970 00:00:00 GMT
DaanHoogland closed pull request #2276: WIP: CLOUDSTACK-10089 log4j update to version 2
URL: https://github.com/apache/cloudstack/pull/2276
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/agent/src/com/cloud/agent/Agent.java b/agent/src/com/cloud/agent/Agent.java
index 7e802205f5c..45f10f46e0a 100644
--- a/agent/src/com/cloud/agent/Agent.java
+++ b/agent/src/com/cloud/agent/Agent.java
@@ -37,16 +37,6 @@
 
 import javax.naming.ConfigurationException;
 
-import org.apache.cloudstack.ca.SetupCertificateAnswer;
-import org.apache.cloudstack.ca.SetupCertificateCommand;
-import org.apache.cloudstack.ca.SetupKeyStoreCommand;
-import org.apache.cloudstack.ca.SetupKeystoreAnswer;
-import org.apache.cloudstack.managed.context.ManagedContextTimerTask;
-import org.apache.cloudstack.utils.security.KeyStoreUtils;
-import org.apache.commons.io.FileUtils;
-import org.apache.log4j.Logger;
-import org.slf4j.MDC;
-
 import com.cloud.agent.api.AgentControlAnswer;
 import com.cloud.agent.api.AgentControlCommand;
 import com.cloud.agent.api.Answer;
@@ -77,6 +67,16 @@
 import com.cloud.utils.script.OutputInterpreter;
 import com.cloud.utils.script.Script;
 import com.google.common.base.Strings;
+import org.apache.cloudstack.ca.SetupCertificateAnswer;
+import org.apache.cloudstack.ca.SetupCertificateCommand;
+import org.apache.cloudstack.ca.SetupKeyStoreCommand;
+import org.apache.cloudstack.ca.SetupKeystoreAnswer;
+import org.apache.cloudstack.managed.context.ManagedContextTimerTask;
+import org.apache.cloudstack.utils.security.KeyStoreUtils;
+import org.apache.commons.io.FileUtils;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.ThreadContext;
 
 /**
  * @config
@@ -92,7 +92,7 @@
  *
  **/
 public class Agent implements HandlerFactory, IAgentControl {
-    private static final Logger s_logger = Logger.getLogger(Agent.class.getName());
+    private static final Logger s_logger = LogManager.getLogger(Agent.class.getName());
 
     public enum ExitStatus {
         Normal(0), // Normal status = 0.
@@ -499,7 +499,7 @@ protected void processRequest(final Request request, final Link link) {
                 Answer answer;
                 try {
                     if (cmd.getContextParam("logid") != null) {
-                        MDC.put("logcontextid", cmd.getContextParam("logid"));
+                        ThreadContext.put("logcontextid", cmd.getContextParam("logid"));
                     }
                     if (s_logger.isDebugEnabled()) {
                         if (!requestLogged) // ensures request is logged only once per method call
@@ -738,7 +738,7 @@ public void processOtherTask(final Task task) {
             final Request req = (Request)obj;
             final Command command = req.getCommand();
             if (command.getContextParam("logid") != null) {
-                MDC.put("logcontextid", command.getContextParam("logid"));
+                ThreadContext.put("logcontextid", command.getContextParam("logid"));
             }
             Answer answer = null;
             _inProgress.incrementAndGet();
diff --git a/agent/src/com/cloud/agent/AgentShell.java b/agent/src/com/cloud/agent/AgentShell.java
index 5950bc78e61..967008d99a2 100644
--- a/agent/src/com/cloud/agent/AgentShell.java
+++ b/agent/src/com/cloud/agent/AgentShell.java
@@ -32,13 +32,6 @@
 
 import javax.naming.ConfigurationException;
 
-import org.apache.commons.daemon.Daemon;
-import org.apache.commons.daemon.DaemonContext;
-import org.apache.commons.daemon.DaemonInitException;
-import org.apache.commons.lang.math.NumberUtils;
-import org.apache.log4j.Logger;
-import org.apache.log4j.xml.DOMConfigurator;
-
 import com.cloud.agent.Agent.ExitStatus;
 import com.cloud.agent.dao.StorageComponent;
 import com.cloud.agent.dao.impl.PropertiesStorage;
@@ -50,9 +43,15 @@
 import com.cloud.utils.backoff.BackoffAlgorithm;
 import com.cloud.utils.backoff.impl.ConstantTimeBackoff;
 import com.cloud.utils.exception.CloudRuntimeException;
+import org.apache.commons.daemon.Daemon;
+import org.apache.commons.daemon.DaemonContext;
+import org.apache.commons.daemon.DaemonInitException;
+import org.apache.commons.lang.math.NumberUtils;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class AgentShell implements IAgentShell, Daemon {
-    private static final Logger s_logger = Logger.getLogger(AgentShell.class.getName());
+    private static final Logger s_logger = LogManager.getLogger(AgentShell.class.getName());
 
     private final Properties _properties = new Properties();
     private final Map<String, Object> _cmdLineProperties = new HashMap<String, Object>();
@@ -316,7 +315,17 @@ public void init(String[] args) throws ConfigurationException {
         }
 
         if (null != file) {
-            DOMConfigurator.configureAndWatch(file.getAbsolutePath());
+            org.apache.logging.log4j.core.config.Configurator.initialize("cloud", file.getAbsolutePath());
+            // TODO watch interval must be set in an updated log4j xml*/
+
+/*
+<?xml version="1.0" encoding="UTF-8"?>
+
+<Configuration monitorInterval="30">
+...
+</Configuration>
+ */
+//            DOMConfigurator.configureAndWatch(file.getAbsolutePath());
 
             s_logger.info("Agent started");
         } else {
diff --git a/agent/src/com/cloud/agent/dao/impl/PropertiesStorage.java b/agent/src/com/cloud/agent/dao/impl/PropertiesStorage.java
index e9eac645cb7..757daba7573 100644
--- a/agent/src/com/cloud/agent/dao/impl/PropertiesStorage.java
+++ b/agent/src/com/cloud/agent/dao/impl/PropertiesStorage.java
@@ -25,11 +25,11 @@
 
 import javax.ejb.Local;
 
-import org.apache.commons.io.IOUtils;
-import org.apache.log4j.Logger;
-
 import com.cloud.agent.dao.StorageComponent;
 import com.cloud.utils.PropertiesUtil;
+import org.apache.commons.io.IOUtils;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 /**
  * Uses Properties to implement storage.
@@ -39,7 +39,7 @@
  **/
 @Local(value = {StorageComponent.class})
 public class PropertiesStorage implements StorageComponent {
-    private static final Logger s_logger = Logger.getLogger(PropertiesStorage.class);
+    private static final Logger s_logger = LogManager.getLogger(PropertiesStorage.class);
     Properties _properties = new Properties();
     File _file;
     String _name;
diff --git a/agent/src/com/cloud/agent/dhcp/DhcpProtocolParserServer.java b/agent/src/com/cloud/agent/dhcp/DhcpProtocolParserServer.java
index 5d75acf6a22..98febf653bd 100644
--- a/agent/src/com/cloud/agent/dhcp/DhcpProtocolParserServer.java
+++ b/agent/src/com/cloud/agent/dhcp/DhcpProtocolParserServer.java
@@ -25,12 +25,13 @@
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.utils.concurrency.NamedThreadFactory;
 
 public class DhcpProtocolParserServer extends Thread {
-    private static final Logger s_logger = Logger.getLogger(DhcpProtocolParserServer.class);;
+    private static final Logger s_logger = LogManager.getLogger(DhcpProtocolParserServer.class);;
     protected ExecutorService _executor;
     private int dhcpServerPort = 67;
     private int bufferSize = 300;
diff --git a/agent/src/com/cloud/agent/dhcp/FakeDhcpSnooper.java b/agent/src/com/cloud/agent/dhcp/FakeDhcpSnooper.java
index 8509b438f5b..fc9b607f68b 100644
--- a/agent/src/com/cloud/agent/dhcp/FakeDhcpSnooper.java
+++ b/agent/src/com/cloud/agent/dhcp/FakeDhcpSnooper.java
@@ -27,14 +27,15 @@
 import javax.ejb.Local;
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.utils.Pair;
 import com.cloud.utils.net.NetUtils;
 
 @Local(value = {DhcpSnooper.class})
 public class FakeDhcpSnooper implements DhcpSnooper {
-    private static final Logger s_logger = Logger.getLogger(FakeDhcpSnooper.class);
+    private static final Logger s_logger = LogManager.getLogger(FakeDhcpSnooper.class);
     private Queue<String> _ipAddresses = new ConcurrentLinkedQueue<String>();
     private Map<String, String> _macIpMap = new ConcurrentHashMap<String, String>();
     private Map<String, InetAddress> _vmIpMap = new ConcurrentHashMap<String, InetAddress>();
diff --git a/agent/src/com/cloud/agent/mockvm/MockVmMgr.java b/agent/src/com/cloud/agent/mockvm/MockVmMgr.java
index b155cb725b1..f293951c532 100644
--- a/agent/src/com/cloud/agent/mockvm/MockVmMgr.java
+++ b/agent/src/com/cloud/agent/mockvm/MockVmMgr.java
@@ -22,14 +22,15 @@
 import java.util.Random;
 import java.util.Set;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.agent.api.to.VirtualMachineTO;
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.vm.VirtualMachine.State;
 
 public class MockVmMgr implements VmMgr {
-    private static final Logger s_logger = Logger.getLogger(MockVmMgr.class);
+    private static final Logger s_logger = LogManager.getLogger(MockVmMgr.class);
 
     private static final int DEFAULT_DOM0_MEM_MB = 128;
     private static final Random randSeed = new Random();
diff --git a/agent/src/com/cloud/agent/resource/consoleproxy/ConsoleProxyResource.java b/agent/src/com/cloud/agent/resource/consoleproxy/ConsoleProxyResource.java
index 1fed3be753c..8730fdf1123 100644
--- a/agent/src/com/cloud/agent/resource/consoleproxy/ConsoleProxyResource.java
+++ b/agent/src/com/cloud/agent/resource/consoleproxy/ConsoleProxyResource.java
@@ -33,7 +33,8 @@
 import javax.naming.ConfigurationException;
 
 import org.apache.cloudstack.managed.context.ManagedContextRunnable;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.agent.Agent.ExitStatus;
 import com.cloud.agent.api.AgentControlAnswer;
@@ -80,7 +81,7 @@
  *
  */
 public class ConsoleProxyResource extends ServerResourceBase implements ServerResource {
-    static final Logger s_logger = Logger.getLogger(ConsoleProxyResource.class);
+    static final Logger s_logger = LogManager.getLogger(ConsoleProxyResource.class);
 
     private final Properties _properties = new Properties();
     private Thread _consoleProxyMain = null;
diff --git a/api/src/com/cloud/agent/api/LogLevel.java b/api/src/com/cloud/agent/api/LogLevel.java
index a8da272f39f..08240290b9f 100644
--- a/api/src/com/cloud/agent/api/LogLevel.java
+++ b/api/src/com/cloud/agent/api/LogLevel.java
@@ -16,15 +16,15 @@
 // under the License.
 package com.cloud.agent.api;
 
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
 import java.lang.annotation.Retention;
 import java.lang.annotation.Target;
 
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.Logger;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
 
 /**
  */
@@ -41,7 +41,7 @@ private Log4jLevel(Level level) {
         }
 
         public boolean enabled(Logger logger) {
-            return _level != Level.OFF && logger.isEnabledFor(_level);
+            return _level != Level.OFF && logger.isEnabled(_level);
         }
     }
 
diff --git a/api/src/org/apache/cloudstack/api/AbstractGetUploadParamsCmd.java b/api/src/org/apache/cloudstack/api/AbstractGetUploadParamsCmd.java
index c82f4789367..e4c69b55d9c 100644
--- a/api/src/org/apache/cloudstack/api/AbstractGetUploadParamsCmd.java
+++ b/api/src/org/apache/cloudstack/api/AbstractGetUploadParamsCmd.java
@@ -25,11 +25,12 @@
 import org.apache.cloudstack.api.response.GetUploadParamsResponse;
 import org.apache.cloudstack.api.response.ProjectResponse;
 import org.apache.cloudstack.api.response.ZoneResponse;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public abstract class AbstractGetUploadParamsCmd extends BaseCmd {
 
-    public static final Logger s_logger = Logger.getLogger(AbstractGetUploadParamsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(AbstractGetUploadParamsCmd.class.getName());
 
     @Parameter(name = ApiConstants.NAME, type = CommandType.STRING, required = true, description = "the name of the volume/template")
     private String name;
diff --git a/api/src/org/apache/cloudstack/api/BaseAsyncCmd.java b/api/src/org/apache/cloudstack/api/BaseAsyncCmd.java
index 8963415d8e3..66971721af4 100644
--- a/api/src/org/apache/cloudstack/api/BaseAsyncCmd.java
+++ b/api/src/org/apache/cloudstack/api/BaseAsyncCmd.java
@@ -17,7 +17,8 @@
 package org.apache.cloudstack.api;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 /**
  * queryAsyncJobResult API command.
@@ -29,7 +30,7 @@
     public static final String vpcSyncObject = "vpc";
     public static final String snapshotHostSyncObject = "snapshothost";
     public static final String gslbSyncObject = "globalserverloadbalancer";
-    private static final Logger s_logger = Logger.getLogger(BaseAsyncCmd.class.getName());
+    private static final Logger s_logger = LogManager.getLogger(BaseAsyncCmd.class.getName());
 
     private Object job;
 
diff --git a/api/src/org/apache/cloudstack/api/BaseCmd.java b/api/src/org/apache/cloudstack/api/BaseCmd.java
index 37dbeaab841..a94fb955f71 100644
--- a/api/src/org/apache/cloudstack/api/BaseCmd.java
+++ b/api/src/org/apache/cloudstack/api/BaseCmd.java
@@ -17,6 +17,18 @@
 
 package org.apache.cloudstack.api;
 
+import java.lang.reflect.Field;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Pattern;
+
+import javax.inject.Inject;
+
 import com.cloud.configuration.ConfigurationService;
 import com.cloud.exception.ConcurrentOperationException;
 import com.cloud.exception.InsufficientCapacityException;
@@ -69,21 +81,11 @@
 import org.apache.cloudstack.network.lb.InternalLoadBalancerVMService;
 import org.apache.cloudstack.query.QueryService;
 import org.apache.cloudstack.usage.UsageService;
-import org.apache.log4j.Logger;
-
-import javax.inject.Inject;
-import java.lang.reflect.Field;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Pattern;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 public abstract class BaseCmd {
-    private static final Logger s_logger = Logger.getLogger(BaseCmd.class.getName());
+    private static final Logger s_logger = LogManager.getLogger(BaseCmd.class.getName());
     public static final String RESPONSE_SUFFIX = "response";
     public static final String RESPONSE_TYPE_XML = HttpUtils.RESPONSE_TYPE_XML;
     public static final String RESPONSE_TYPE_JSON = HttpUtils.RESPONSE_TYPE_JSON;
diff --git a/api/src/org/apache/cloudstack/api/BaseListTemplateOrIsoPermissionsCmd.java b/api/src/org/apache/cloudstack/api/BaseListTemplateOrIsoPermissionsCmd.java
index d149dffe291..a3914e97ff3 100644
--- a/api/src/org/apache/cloudstack/api/BaseListTemplateOrIsoPermissionsCmd.java
+++ b/api/src/org/apache/cloudstack/api/BaseListTemplateOrIsoPermissionsCmd.java
@@ -18,7 +18,8 @@
 
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.ResponseObject.ResponseView;
 import org.apache.cloudstack.api.response.TemplatePermissionsResponse;
@@ -60,7 +61,7 @@ public long getEntityOwnerId() {
     }
 
     protected Logger getLogger() {
-        return Logger.getLogger(BaseListTemplateOrIsoPermissionsCmd.class);
+        return LogManager.getLogger(BaseListTemplateOrIsoPermissionsCmd.class);
     }
 
     @Override
diff --git a/api/src/org/apache/cloudstack/api/BaseUpdateTemplateOrIsoCmd.java b/api/src/org/apache/cloudstack/api/BaseUpdateTemplateOrIsoCmd.java
index 36767345a4b..5a469979c4e 100644
--- a/api/src/org/apache/cloudstack/api/BaseUpdateTemplateOrIsoCmd.java
+++ b/api/src/org/apache/cloudstack/api/BaseUpdateTemplateOrIsoCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.apache.cloudstack.api.command.user.iso.UpdateIsoCmd;
 import org.apache.cloudstack.api.response.GuestOSResponse;
 import org.apache.cloudstack.api.response.TemplateResponse;
@@ -25,7 +26,7 @@
 import java.util.Map;
 
 public abstract class BaseUpdateTemplateOrIsoCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateIsoCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateIsoCmd.class.getName());
 
     /////////////////////////////////////////////////////
     //////////////// API parameters /////////////////////
diff --git a/api/src/org/apache/cloudstack/api/BaseUpdateTemplateOrIsoPermissionsCmd.java b/api/src/org/apache/cloudstack/api/BaseUpdateTemplateOrIsoPermissionsCmd.java
index 77e5a15b09e..e35510b63d8 100644
--- a/api/src/org/apache/cloudstack/api/BaseUpdateTemplateOrIsoPermissionsCmd.java
+++ b/api/src/org/apache/cloudstack/api/BaseUpdateTemplateOrIsoPermissionsCmd.java
@@ -18,7 +18,8 @@
 
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.response.ProjectResponse;
 import org.apache.cloudstack.api.response.SuccessResponse;
@@ -35,7 +36,7 @@
     // ///////////////////////////////////////////////////
 
     protected Logger getLogger() {
-        return Logger.getLogger(BaseUpdateTemplateOrIsoPermissionsCmd.class);
+        return LogManager.getLogger(BaseUpdateTemplateOrIsoPermissionsCmd.class);
     }
 
     protected String getResponseName() {
diff --git a/api/src/org/apache/cloudstack/api/command/admin/account/CreateAccountCmd.java b/api/src/org/apache/cloudstack/api/command/admin/account/CreateAccountCmd.java
index 074df8d5fc2..ceae42fb8fa 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/account/CreateAccountCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/account/CreateAccountCmd.java
@@ -20,7 +20,8 @@
 import java.util.Map;
 
 import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.api.APICommand;
@@ -42,7 +43,7 @@
 @APICommand(name = "createAccount", description = "Creates an account", responseObject = AccountResponse.class, entityType = {Account.class},
         requestHasSensitiveInfo = true, responseHasSensitiveInfo = true)
 public class CreateAccountCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateAccountCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateAccountCmd.class.getName());
 
     private static final String s_name = "createaccountresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/account/DeleteAccountCmd.java b/api/src/org/apache/cloudstack/api/command/admin/account/DeleteAccountCmd.java
index 2a2e16dd0bd..780c1e9be54 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/account/DeleteAccountCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/account/DeleteAccountCmd.java
@@ -18,7 +18,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -41,7 +42,7 @@
 @APICommand(name = "deleteAccount", description = "Deletes a account, and all users associated with this account", responseObject = SuccessResponse.class, entityType = {Account.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteAccountCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteAccountCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteAccountCmd.class.getName());
     private static final String s_name = "deleteaccountresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/account/DisableAccountCmd.java b/api/src/org/apache/cloudstack/api/command/admin/account/DisableAccountCmd.java
index 3e5e1d3d017..9b072695146 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/account/DisableAccountCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/account/DisableAccountCmd.java
@@ -18,7 +18,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -43,7 +44,7 @@
 @APICommand(name = "disableAccount", description = "Disables an account", responseObject = AccountResponse.class, entityType = {Account.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class DisableAccountCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DisableAccountCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DisableAccountCmd.class.getName());
     private static final String s_name = "disableaccountresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/account/EnableAccountCmd.java b/api/src/org/apache/cloudstack/api/command/admin/account/EnableAccountCmd.java
index f30c985c961..c63ad4c0801 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/account/EnableAccountCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/account/EnableAccountCmd.java
@@ -18,7 +18,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -38,7 +39,7 @@
 @APICommand(name = "enableAccount", description = "Enables an account", responseObject = AccountResponse.class, entityType = {Account.class},
     requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class EnableAccountCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(EnableAccountCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(EnableAccountCmd.class.getName());
     private static final String s_name = "enableaccountresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/account/LockAccountCmd.java b/api/src/org/apache/cloudstack/api/command/admin/account/LockAccountCmd.java
index 05b370abda5..5bc834daae5 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/account/LockAccountCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/account/LockAccountCmd.java
@@ -16,17 +16,16 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.account;
 
-import java.util.logging.Logger;
-
+import com.cloud.user.Account;
+import com.cloud.utils.exception.CloudRuntimeException;
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.BaseCmd;
 import org.apache.cloudstack.api.Parameter;
 import org.apache.cloudstack.api.response.AccountResponse;
 import org.apache.cloudstack.api.response.DomainResponse;
-
-import com.cloud.user.Account;
-import com.cloud.utils.exception.CloudRuntimeException;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 @APICommand(name = "lockAccount",
             description = "This deprecated function used to locks an account. Look for the API DisableAccount instead",
@@ -35,7 +34,7 @@
             requestHasSensitiveInfo = false,
             responseHasSensitiveInfo = true)
 public class LockAccountCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(LockAccountCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(LockAccountCmd.class.getName());
 
     private static final String s_name = "lockaccountresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/account/UpdateAccountCmd.java b/api/src/org/apache/cloudstack/api/command/admin/account/UpdateAccountCmd.java
index a7ce74a1292..eb965981714 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/account/UpdateAccountCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/account/UpdateAccountCmd.java
@@ -21,7 +21,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -41,7 +42,7 @@
 @APICommand(name = "updateAccount", description = "Updates account information for the authenticated user", responseObject = AccountResponse.class, entityType = {Account.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class UpdateAccountCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateAccountCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateAccountCmd.class.getName());
     private static final String s_name = "updateaccountresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/address/AcquirePodIpCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/address/AcquirePodIpCmdByAdmin.java
index fea0ca64d9c..9c85c126b5a 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/address/AcquirePodIpCmdByAdmin.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/address/AcquirePodIpCmdByAdmin.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.address;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -35,7 +36,7 @@
 @APICommand(name = "acquirePodIpAddress", description = "Allocates IP addresses in respective Pod of a Zone", responseObject = AcquirePodIpCmdResponse.class, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class AcquirePodIpCmdByAdmin extends BaseCmd {
 
-    public static final Logger s_logger = Logger.getLogger(AcquirePodIpCmdByAdmin.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(AcquirePodIpCmdByAdmin.class.getName());
     private static final String s_name = "acquirepodipaddress";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/address/AssociateIPAddrCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/address/AssociateIPAddrCmdByAdmin.java
index e428ac83683..9aa60a5767e 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/address/AssociateIPAddrCmdByAdmin.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/address/AssociateIPAddrCmdByAdmin.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.address;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiErrorCode;
@@ -35,7 +36,7 @@
 @APICommand(name = "associateIpAddress", description = "Acquires and associates a public IP to an account.", responseObject = IPAddressResponse.class, responseView = ResponseView.Full,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class AssociateIPAddrCmdByAdmin extends AssociateIPAddrCmd {
-    public static final Logger s_logger = Logger.getLogger(AssociateIPAddrCmdByAdmin.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(AssociateIPAddrCmdByAdmin.class.getName());
 
 
     @Override
diff --git a/api/src/org/apache/cloudstack/api/command/admin/address/ListPublicIpAddressesCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/address/ListPublicIpAddressesCmdByAdmin.java
index 22627a27378..fb61c4a1110 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/address/ListPublicIpAddressesCmdByAdmin.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/address/ListPublicIpAddressesCmdByAdmin.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ResponseObject.ResponseView;
@@ -33,7 +34,7 @@
 @APICommand(name = "listPublicIpAddresses", description = "Lists all public ip addresses", responseObject = IPAddressResponse.class, responseView = ResponseView.Full,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false, entityType = {IpAddress.class})
 public class ListPublicIpAddressesCmdByAdmin extends ListPublicIpAddressesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListPublicIpAddressesCmdByAdmin.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListPublicIpAddressesCmdByAdmin.class.getName());
 
     @Override
     public void execute(){
diff --git a/api/src/org/apache/cloudstack/api/command/admin/address/ReleasePodIpCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/address/ReleasePodIpCmdByAdmin.java
index 750a85d57f2..48fb69bc658 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/address/ReleasePodIpCmdByAdmin.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/address/ReleasePodIpCmdByAdmin.java
@@ -16,7 +16,8 @@
 //under the License.
 package org.apache.cloudstack.api.command.admin.address;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -32,7 +33,7 @@
 
 @APICommand(name = "releasePodIpAddress", description = "Releases a Pod IP back to the Pod", responseObject = SuccessResponse.class, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ReleasePodIpCmdByAdmin extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(ReleasePublicIpRangeCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ReleasePublicIpRangeCmd.class.getName());
 
     private static final String s_name = "releasepodipresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/affinitygroup/UpdateVMAffinityGroupCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/affinitygroup/UpdateVMAffinityGroupCmdByAdmin.java
index b0a6caedb5a..7bb93e8d4a0 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/affinitygroup/UpdateVMAffinityGroupCmdByAdmin.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/affinitygroup/UpdateVMAffinityGroupCmdByAdmin.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.EnumSet;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants.VMDetails;
@@ -42,7 +43,7 @@
         requestHasSensitiveInfo = false,
         responseHasSensitiveInfo = true)
 public class UpdateVMAffinityGroupCmdByAdmin extends UpdateVMAffinityGroupCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateVMAffinityGroupCmdByAdmin.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateVMAffinityGroupCmdByAdmin.class.getName());
 
 
     @Override
diff --git a/api/src/org/apache/cloudstack/api/command/admin/alert/GenerateAlertCmd.java b/api/src/org/apache/cloudstack/api/command/admin/alert/GenerateAlertCmd.java
index 58920d7dd74..24beab0a14a 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/alert/GenerateAlertCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/alert/GenerateAlertCmd.java
@@ -27,7 +27,8 @@
 import org.apache.cloudstack.api.response.PodResponse;
 import org.apache.cloudstack.api.response.SuccessResponse;
 import org.apache.cloudstack.api.response.ZoneResponse;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.event.EventTypes;
 
@@ -35,7 +36,7 @@
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class GenerateAlertCmd extends BaseAsyncCmd {
 
-    public static final Logger s_logger = Logger.getLogger(GenerateAlertCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(GenerateAlertCmd.class.getName());
 
     private static final String s_name = "generatealertresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/autoscale/CreateCounterCmd.java b/api/src/org/apache/cloudstack/api/command/admin/autoscale/CreateCounterCmd.java
index ea715663d9c..f3a018a0d80 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/autoscale/CreateCounterCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/autoscale/CreateCounterCmd.java
@@ -17,7 +17,8 @@
 
 package org.apache.cloudstack.api.command.admin.autoscale;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -35,7 +36,7 @@
 @APICommand(name = "createCounter", description = "Adds metric counter", responseObject = CounterResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreateCounterCmd extends BaseAsyncCreateCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateCounterCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateCounterCmd.class.getName());
     private static final String s_name = "counterresponse";
 
     // ///////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/autoscale/DeleteCounterCmd.java b/api/src/org/apache/cloudstack/api/command/admin/autoscale/DeleteCounterCmd.java
index 3547ef10c8c..f7f25d895ac 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/autoscale/DeleteCounterCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/autoscale/DeleteCounterCmd.java
@@ -17,7 +17,8 @@
 
 package org.apache.cloudstack.api.command.admin.autoscale;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -36,7 +37,7 @@
 @APICommand(name = "deleteCounter", description = "Deletes a counter", responseObject = SuccessResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteCounterCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteCounterCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteCounterCmd.class.getName());
     private static final String s_name = "deletecounterresponse";
 
     // ///////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/ca/IssueCertificateCmd.java b/api/src/org/apache/cloudstack/api/command/admin/ca/IssueCertificateCmd.java
index 8926829205f..4b0ce73134e 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/ca/IssueCertificateCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/ca/IssueCertificateCmd.java
@@ -36,7 +36,8 @@
 import org.apache.cloudstack.context.CallContext;
 import org.apache.cloudstack.framework.ca.Certificate;
 import org.apache.cloudstack.utils.security.CertUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.event.EventTypes;
 import com.google.common.base.Strings;
@@ -49,7 +50,7 @@
         since = "4.11.0",
         authorized = {RoleType.Admin})
 public class IssueCertificateCmd extends BaseAsyncCmd {
-    private static final Logger LOG = Logger.getLogger(IssueCertificateCmd.class);
+    private static final Logger LOG = LogManager.getLogger(IssueCertificateCmd.class);
 
     public static final String APINAME = "issueCertificate";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/cluster/AddClusterCmd.java b/api/src/org/apache/cloudstack/api/command/admin/cluster/AddClusterCmd.java
index 3d0d7149740..63d97812ecd 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/cluster/AddClusterCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/cluster/AddClusterCmd.java
@@ -20,7 +20,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -41,7 +42,7 @@
 @APICommand(name = "addCluster", description = "Adds a new cluster", responseObject = ClusterResponse.class,
         requestHasSensitiveInfo = true, responseHasSensitiveInfo = false)
 public class AddClusterCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(AddClusterCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(AddClusterCmd.class.getName());
 
     private static final String s_name = "addclusterresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/cluster/DeleteClusterCmd.java b/api/src/org/apache/cloudstack/api/command/admin/cluster/DeleteClusterCmd.java
index 5d046758007..3d42d0ed8c1 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/cluster/DeleteClusterCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/cluster/DeleteClusterCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.cluster;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -32,7 +33,7 @@
 @APICommand(name = "deleteCluster", description = "Deletes a cluster.", responseObject = SuccessResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteClusterCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteClusterCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteClusterCmd.class.getName());
 
     private static final String s_name = "deleteclusterresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/cluster/ListClustersCmd.java b/api/src/org/apache/cloudstack/api/command/admin/cluster/ListClustersCmd.java
index 74ad764608c..0f9b13d861c 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/cluster/ListClustersCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/cluster/ListClustersCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -37,7 +38,7 @@
 @APICommand(name = "listClusters", description = "Lists clusters.", responseObject = ClusterResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListClustersCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListServiceOfferingsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListServiceOfferingsCmd.class.getName());
 
     private static final String s_name = "listclustersresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/cluster/UpdateClusterCmd.java b/api/src/org/apache/cloudstack/api/command/admin/cluster/UpdateClusterCmd.java
index 53d01c58a56..5ad095c25d9 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/cluster/UpdateClusterCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/cluster/UpdateClusterCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.cluster;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -33,7 +34,7 @@
 @APICommand(name = "updateCluster", description = "Updates an existing cluster", responseObject = ClusterResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateClusterCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(AddClusterCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(AddClusterCmd.class.getName());
 
     private static final String s_name = "updateclusterresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/config/ListCfgsByCmd.java b/api/src/org/apache/cloudstack/api/command/admin/config/ListCfgsByCmd.java
index 8f71f48470e..5b6f48ec524 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/config/ListCfgsByCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/config/ListCfgsByCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -39,7 +40,7 @@
 @APICommand(name = "listConfigurations", description = "Lists all configurations.", responseObject = ConfigurationResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListCfgsByCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListCfgsByCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListCfgsByCmd.class.getName());
 
     private static final String s_name = "listconfigurationsresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/config/ListDeploymentPlannersCmd.java b/api/src/org/apache/cloudstack/api/command/admin/config/ListDeploymentPlannersCmd.java
index b5a24b9bda8..8e567312979 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/config/ListDeploymentPlannersCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/config/ListDeploymentPlannersCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.BaseListCmd;
@@ -29,7 +30,7 @@
 @APICommand(name = "listDeploymentPlanners", description = "Lists all DeploymentPlanners available.", responseObject = DeploymentPlannersResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListDeploymentPlannersCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListDeploymentPlannersCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListDeploymentPlannersCmd.class.getName());
 
     private static final String s_name = "listdeploymentplannersresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/config/ListHypervisorCapabilitiesCmd.java b/api/src/org/apache/cloudstack/api/command/admin/config/ListHypervisorCapabilitiesCmd.java
index 6d3c2012af7..0fc38bd4d36 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/config/ListHypervisorCapabilitiesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/config/ListHypervisorCapabilitiesCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -39,7 +40,7 @@
             requestHasSensitiveInfo = false,
             responseHasSensitiveInfo = false)
 public class ListHypervisorCapabilitiesCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListHypervisorCapabilitiesCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListHypervisorCapabilitiesCmd.class.getName());
 
     private static final String s_name = "listhypervisorcapabilitiesresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/config/UpdateCfgCmd.java b/api/src/org/apache/cloudstack/api/command/admin/config/UpdateCfgCmd.java
index fa5e26e418f..97a8a56f550 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/config/UpdateCfgCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/config/UpdateCfgCmd.java
@@ -18,7 +18,8 @@
 
 import com.google.common.base.Strings;
 import org.apache.cloudstack.acl.RoleService;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiArgValidator;
 import org.apache.cloudstack.api.ApiConstants;
@@ -39,7 +40,7 @@
 @APICommand(name = "updateConfiguration", description = "Updates a configuration.", responseObject = ConfigurationResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateCfgCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateCfgCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateCfgCmd.class.getName());
     private static final String s_name = "updateconfigurationresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/config/UpdateHypervisorCapabilitiesCmd.java b/api/src/org/apache/cloudstack/api/command/admin/config/UpdateHypervisorCapabilitiesCmd.java
index 6550c89240b..9ee07c40ac9 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/config/UpdateHypervisorCapabilitiesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/config/UpdateHypervisorCapabilitiesCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.config;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -36,7 +37,7 @@
             requestHasSensitiveInfo = false,
             responseHasSensitiveInfo = false)
 public class UpdateHypervisorCapabilitiesCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateHypervisorCapabilitiesCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateHypervisorCapabilitiesCmd.class.getName());
     private static final String s_name = "updatehypervisorcapabilitiesresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/domain/CreateDomainCmd.java b/api/src/org/apache/cloudstack/api/command/admin/domain/CreateDomainCmd.java
index fe1c20206b6..99f8b240ab2 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/domain/CreateDomainCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/domain/CreateDomainCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.domain;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -34,7 +35,7 @@
  requestHasSensitiveInfo = false, responseHasSensitiveInfo = false, authorized = {
         RoleType.Admin, RoleType.DomainAdmin })
 public class CreateDomainCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateDomainCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateDomainCmd.class.getName());
 
     private static final String s_name = "createdomainresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/domain/DeleteDomainCmd.java b/api/src/org/apache/cloudstack/api/command/admin/domain/DeleteDomainCmd.java
index 037cf3d9ab4..743fa27a883 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/domain/DeleteDomainCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/domain/DeleteDomainCmd.java
@@ -29,7 +29,8 @@
 import org.apache.cloudstack.api.response.SuccessResponse;
 import org.apache.cloudstack.context.CallContext;
 import org.apache.cloudstack.region.RegionService;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.domain.Domain;
 import com.cloud.event.EventTypes;
@@ -39,7 +40,7 @@
 requestHasSensitiveInfo = false, responseHasSensitiveInfo = false, authorized = {
         RoleType.Admin, RoleType.DomainAdmin })
 public class DeleteDomainCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteDomainCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteDomainCmd.class.getName());
     private static final String s_name = "deletedomainresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/domain/ListDomainChildrenCmd.java b/api/src/org/apache/cloudstack/api/command/admin/domain/ListDomainChildrenCmd.java
index cf35295358b..690c3f44f63 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/domain/ListDomainChildrenCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/domain/ListDomainChildrenCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -34,7 +35,7 @@
 @APICommand(name = "listDomainChildren", description = "Lists all children domains belonging to a specified domain", responseObject = DomainResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListDomainChildrenCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListDomainChildrenCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListDomainChildrenCmd.class.getName());
 
     private static final String s_name = "listdomainchildrenresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/domain/ListDomainsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/domain/ListDomainsCmd.java
index 9c1ae221328..5520a6e16b1 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/domain/ListDomainsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/domain/ListDomainsCmd.java
@@ -20,7 +20,8 @@
 import java.util.EnumSet;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -37,7 +38,7 @@
 @APICommand(name = "listDomains", description = "Lists domains and provides detailed information for listed domains", responseObject = DomainResponse.class, responseView = ResponseView.Restricted, entityType = {Domain.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListDomainsCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListDomainsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListDomainsCmd.class.getName());
 
     private static final String s_name = "listdomainsresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/domain/UpdateDomainCmd.java b/api/src/org/apache/cloudstack/api/command/admin/domain/UpdateDomainCmd.java
index 409a84d7d80..0524dd9f23e 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/domain/UpdateDomainCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/domain/UpdateDomainCmd.java
@@ -18,7 +18,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -36,7 +37,7 @@
 @APICommand(name = "updateDomain", description = "Updates a domain with a new name", responseObject = DomainResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateDomainCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateDomainCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateDomainCmd.class.getName());
     private static final String s_name = "updatedomainresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/guest/AddGuestOsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/guest/AddGuestOsCmd.java
index 717bcfe8155..83e4e879ad8 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/guest/AddGuestOsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/guest/AddGuestOsCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.guest;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -41,7 +42,7 @@
 @APICommand(name = "addGuestOs", description = "Add a new guest OS type", responseObject = GuestOSResponse.class,
         since = "4.4.0", requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class AddGuestOsCmd extends BaseAsyncCreateCmd {
-    public static final Logger s_logger = Logger.getLogger(AddGuestOsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(AddGuestOsCmd.class.getName());
 
     private static final String s_name = "addguestosresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/guest/AddGuestOsMappingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/guest/AddGuestOsMappingCmd.java
index 8af50a15bfa..5e129f9e7ce 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/guest/AddGuestOsMappingCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/guest/AddGuestOsMappingCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.guest;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -35,7 +36,7 @@
 @APICommand(name = "addGuestOsMapping", description = "Adds a guest OS name to hypervisor OS name mapping", responseObject = GuestOsMappingResponse.class,
         since = "4.4.0", requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class AddGuestOsMappingCmd extends BaseAsyncCreateCmd {
-    public static final Logger s_logger = Logger.getLogger(AddGuestOsMappingCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(AddGuestOsMappingCmd.class.getName());
 
     private static final String s_name = "addguestosmappingresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/guest/ListGuestOsMappingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/guest/ListGuestOsMappingCmd.java
index a7fc9e0decd..d5b8b8519a6 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/guest/ListGuestOsMappingCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/guest/ListGuestOsMappingCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -35,7 +36,7 @@
 @APICommand(name = "listGuestOsMapping", description = "Lists all available OS mappings for given hypervisor", responseObject = GuestOsMappingResponse.class,
         since = "4.4.0", requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListGuestOsMappingCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListGuestOsMappingCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListGuestOsMappingCmd.class.getName());
 
     private static final String s_name = "listguestosmappingresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/guest/RemoveGuestOsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/guest/RemoveGuestOsCmd.java
index 3de7f7a68da..6d7c78c33f1 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/guest/RemoveGuestOsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/guest/RemoveGuestOsCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.guest;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -36,7 +37,7 @@
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class RemoveGuestOsCmd extends BaseAsyncCmd {
 
-    public static final Logger s_logger = Logger.getLogger(RemoveGuestOsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(RemoveGuestOsCmd.class.getName());
     private static final String s_name = "removeguestosresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/guest/RemoveGuestOsMappingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/guest/RemoveGuestOsMappingCmd.java
index ddd45399de2..c98f3d452e3 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/guest/RemoveGuestOsMappingCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/guest/RemoveGuestOsMappingCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.guest;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -36,7 +37,7 @@
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class RemoveGuestOsMappingCmd extends BaseAsyncCmd {
 
-    public static final Logger s_logger = Logger.getLogger(RemoveGuestOsMappingCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(RemoveGuestOsMappingCmd.class.getName());
     private static final String s_name = "removeguestosmappingresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/guest/UpdateGuestOsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/guest/UpdateGuestOsCmd.java
index ff3b49d79be..4221f92ed20 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/guest/UpdateGuestOsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/guest/UpdateGuestOsCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.guest;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -40,7 +41,7 @@
         since = "4.4.0", requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateGuestOsCmd extends BaseAsyncCmd {
 
-    public static final Logger s_logger = Logger.getLogger(UpdateGuestOsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateGuestOsCmd.class.getName());
 
     private static final String s_name = "updateguestosresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/guest/UpdateGuestOsMappingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/guest/UpdateGuestOsMappingCmd.java
index d760d534cfb..5ad10f36814 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/guest/UpdateGuestOsMappingCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/guest/UpdateGuestOsMappingCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.guest;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -34,7 +35,7 @@
 @APICommand(name = "updateGuestOsMapping", description = "Updates the information about Guest OS to Hypervisor specific name mapping", responseObject = GuestOsMappingResponse.class,
         since = "4.4.0", requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateGuestOsMappingCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateGuestOsMappingCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateGuestOsMappingCmd.class.getName());
 
     private static final String s_name = "updateguestosmappingresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/host/AddHostCmd.java b/api/src/org/apache/cloudstack/api/command/admin/host/AddHostCmd.java
index 960be8df577..0a507bddef1 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/host/AddHostCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/host/AddHostCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -40,7 +41,7 @@
 @APICommand(name = "addHost", description = "Adds a new host.", responseObject = HostResponse.class,
         requestHasSensitiveInfo = true, responseHasSensitiveInfo = false)
 public class AddHostCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(AddHostCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(AddHostCmd.class.getName());
 
     private static final String s_name = "addhostresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/host/AddSecondaryStorageCmd.java b/api/src/org/apache/cloudstack/api/command/admin/host/AddSecondaryStorageCmd.java
index 9108d600419..19b8c39fb76 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/host/AddSecondaryStorageCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/host/AddSecondaryStorageCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.host;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -34,7 +35,7 @@
 @APICommand(name = "addSecondaryStorage", description = "Adds secondary storage.", responseObject = ImageStoreResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class AddSecondaryStorageCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(AddSecondaryStorageCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(AddSecondaryStorageCmd.class.getName());
     private static final String s_name = "addsecondarystorageresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/host/CancelMaintenanceCmd.java b/api/src/org/apache/cloudstack/api/command/admin/host/CancelMaintenanceCmd.java
index d23a7651bbc..1cd50ab60fd 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/host/CancelMaintenanceCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/host/CancelMaintenanceCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.host;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -35,7 +36,7 @@
 @APICommand(name = "cancelHostMaintenance", description = "Cancels host maintenance.", responseObject = HostResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CancelMaintenanceCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(CancelMaintenanceCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CancelMaintenanceCmd.class.getName());
 
     private static final String s_name = "cancelhostmaintenanceresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/host/DeleteHostCmd.java b/api/src/org/apache/cloudstack/api/command/admin/host/DeleteHostCmd.java
index b9945281296..dd6d7073f47 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/host/DeleteHostCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/host/DeleteHostCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.host;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -32,7 +33,7 @@
 @APICommand(name = "deleteHost", description = "Deletes a host.", responseObject = SuccessResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteHostCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteHostCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteHostCmd.class.getName());
 
     private static final String s_name = "deletehostresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/host/FindHostsForMigrationCmd.java b/api/src/org/apache/cloudstack/api/command/admin/host/FindHostsForMigrationCmd.java
index ad9b6af3436..7683247def1 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/host/FindHostsForMigrationCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/host/FindHostsForMigrationCmd.java
@@ -20,7 +20,8 @@
 import java.util.List;
 import java.util.Map;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -37,7 +38,7 @@
 @APICommand(name = "findHostsForMigration", description = "Find hosts suitable for migrating a virtual machine.", responseObject = HostForMigrationResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class FindHostsForMigrationCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(FindHostsForMigrationCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(FindHostsForMigrationCmd.class.getName());
 
     private static final String s_name = "findhostsformigrationresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/host/ListHostTagsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/host/ListHostTagsCmd.java
index 5f55ada61da..e6a61b3667a 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/host/ListHostTagsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/host/ListHostTagsCmd.java
@@ -18,7 +18,8 @@
  */
 package org.apache.cloudstack.api.command.admin.host;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
 import org.apache.cloudstack.api.BaseListCmd;
@@ -27,7 +28,7 @@
 
 @APICommand(name = "listHostTags", description = "Lists host tags", responseObject = HostTagResponse.class, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListHostTagsCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListHostTagsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListHostTagsCmd.class.getName());
 
     private static final String s_name = "listhosttagsresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/host/ListHostsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/host/ListHostsCmd.java
index 9a5d3115b59..483419ed7cb 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/host/ListHostsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/host/ListHostsCmd.java
@@ -21,7 +21,8 @@
 import java.util.List;
 import java.util.Map;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -45,7 +46,7 @@
 @APICommand(name = "listHosts", description = "Lists hosts.", responseObject = HostResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListHostsCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListHostsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListHostsCmd.class.getName());
 
     private static final String s_name = "listhostsresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/host/PrepareForMaintenanceCmd.java b/api/src/org/apache/cloudstack/api/command/admin/host/PrepareForMaintenanceCmd.java
index e49aabc49d4..cdbee6b3c97 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/host/PrepareForMaintenanceCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/host/PrepareForMaintenanceCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.host;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -35,7 +36,7 @@
 @APICommand(name = "prepareHostForMaintenance", description = "Prepares a host for maintenance.", responseObject = HostResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class PrepareForMaintenanceCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(PrepareForMaintenanceCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(PrepareForMaintenanceCmd.class.getName());
 
     private static final String s_name = "preparehostformaintenanceresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/host/ReconnectHostCmd.java b/api/src/org/apache/cloudstack/api/command/admin/host/ReconnectHostCmd.java
index 5e156372681..5d37b079d45 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/host/ReconnectHostCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/host/ReconnectHostCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.host;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -35,7 +36,7 @@
 @APICommand(name = "reconnectHost", description = "Reconnects a host.", responseObject = HostResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ReconnectHostCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(ReconnectHostCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ReconnectHostCmd.class.getName());
 
     private static final String s_name = "reconnecthostresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/host/ReleaseHostReservationCmd.java b/api/src/org/apache/cloudstack/api/command/admin/host/ReleaseHostReservationCmd.java
index 6aeff6312c9..4e5197d85f0 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/host/ReleaseHostReservationCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/host/ReleaseHostReservationCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.host;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -35,7 +36,7 @@
 @APICommand(name = "releaseHostReservation", description = "Releases host reservation.", responseObject = SuccessResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ReleaseHostReservationCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(ReleaseHostReservationCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ReleaseHostReservationCmd.class.getName());
 
     private static final String s_name = "releasehostreservationresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/host/UpdateHostCmd.java b/api/src/org/apache/cloudstack/api/command/admin/host/UpdateHostCmd.java
index aa0a690e2a9..6d27a48ba82 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/host/UpdateHostCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/host/UpdateHostCmd.java
@@ -20,6 +20,10 @@
 import com.cloud.user.Account;
 import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.annotation.AnnotationService;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.ApiErrorCode;
@@ -28,14 +32,13 @@
 import org.apache.cloudstack.api.ServerApiException;
 import org.apache.cloudstack.api.response.GuestOSCategoryResponse;
 import org.apache.cloudstack.api.response.HostResponse;
-import org.apache.log4j.Logger;
 
 import java.util.List;
 
 @APICommand(name = "updateHost", description = "Updates a host.", responseObject = HostResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateHostCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateHostCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateHostCmd.class.getName());
     private static final String s_name = "updatehostresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/host/UpdateHostPasswordCmd.java b/api/src/org/apache/cloudstack/api/command/admin/host/UpdateHostPasswordCmd.java
index 5a884cf72ab..6c8f203cdb6 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/host/UpdateHostPasswordCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/host/UpdateHostPasswordCmd.java
@@ -23,14 +23,15 @@
 import org.apache.cloudstack.api.response.ClusterResponse;
 import org.apache.cloudstack.api.response.HostResponse;
 import org.apache.cloudstack.api.response.SuccessResponse;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.user.Account;
 
 @APICommand(name = "updateHostPassword", description = "Update password of a host/pool on management server.", responseObject = SuccessResponse.class,
 requestHasSensitiveInfo = true, responseHasSensitiveInfo = false)
 public class UpdateHostPasswordCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateHostPasswordCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateHostPasswordCmd.class.getName());
 
     private static final String s_name = "updatehostpasswordresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/internallb/ConfigureInternalLoadBalancerElementCmd.java b/api/src/org/apache/cloudstack/api/command/admin/internallb/ConfigureInternalLoadBalancerElementCmd.java
index 7e39749ff17..041c1e4e7df 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/internallb/ConfigureInternalLoadBalancerElementCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/internallb/ConfigureInternalLoadBalancerElementCmd.java
@@ -21,7 +21,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -47,7 +48,7 @@
             requestHasSensitiveInfo = false,
             responseHasSensitiveInfo = false)
 public class ConfigureInternalLoadBalancerElementCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(ConfigureInternalLoadBalancerElementCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ConfigureInternalLoadBalancerElementCmd.class.getName());
     private static final String s_name = "configureinternalloadbalancerelementresponse";
 
     @Inject
diff --git a/api/src/org/apache/cloudstack/api/command/admin/internallb/CreateInternalLoadBalancerElementCmd.java b/api/src/org/apache/cloudstack/api/command/admin/internallb/CreateInternalLoadBalancerElementCmd.java
index b9c61f3bf90..5ce61302991 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/internallb/CreateInternalLoadBalancerElementCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/internallb/CreateInternalLoadBalancerElementCmd.java
@@ -20,7 +20,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -45,7 +46,7 @@
             requestHasSensitiveInfo = false,
             responseHasSensitiveInfo = false)
 public class CreateInternalLoadBalancerElementCmd extends BaseAsyncCreateCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateInternalLoadBalancerElementCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateInternalLoadBalancerElementCmd.class.getName());
     private static final String s_name = "createinternalloadbalancerelementresponse";
 
     @Inject
diff --git a/api/src/org/apache/cloudstack/api/command/admin/internallb/ListInternalLBVMsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/internallb/ListInternalLBVMsCmd.java
index ba2054c3c24..d55049f8e4f 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/internallb/ListInternalLBVMsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/internallb/ListInternalLBVMsCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.internallb;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -38,7 +39,7 @@
 @APICommand(name = "listInternalLoadBalancerVMs", description = "List internal LB VMs.", responseObject = DomainRouterResponse.class, entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListInternalLBVMsCmd extends BaseListProjectAndAccountResourcesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListInternalLBVMsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListInternalLBVMsCmd.class.getName());
 
     private static final String s_name = "listinternallbvmsresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/internallb/ListInternalLoadBalancerElementsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/internallb/ListInternalLoadBalancerElementsCmd.java
index 8f62b419691..637d54f88e3 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/internallb/ListInternalLoadBalancerElementsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/internallb/ListInternalLoadBalancerElementsCmd.java
@@ -21,7 +21,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -46,7 +47,7 @@
             requestHasSensitiveInfo = false,
             responseHasSensitiveInfo = false)
 public class ListInternalLoadBalancerElementsCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListInternalLoadBalancerElementsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListInternalLoadBalancerElementsCmd.class.getName());
     private static final String s_name = "listinternalloadbalancerelementsresponse";
 
     @Inject
diff --git a/api/src/org/apache/cloudstack/api/command/admin/internallb/StartInternalLBVMCmd.java b/api/src/org/apache/cloudstack/api/command/admin/internallb/StartInternalLBVMCmd.java
index 7040e7cf29a..94dcba7c869 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/internallb/StartInternalLBVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/internallb/StartInternalLBVMCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.internallb;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -42,7 +43,7 @@
 @APICommand(name = "startInternalLoadBalancerVM", responseObject = DomainRouterResponse.class, description = "Starts an existing internal lb vm.", entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class StartInternalLBVMCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(StartInternalLBVMCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(StartInternalLBVMCmd.class.getName());
     private static final String s_name = "startinternallbvmresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/internallb/StopInternalLBVMCmd.java b/api/src/org/apache/cloudstack/api/command/admin/internallb/StopInternalLBVMCmd.java
index 51a3d9f8fa0..b1bad226d4c 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/internallb/StopInternalLBVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/internallb/StopInternalLBVMCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.internallb;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -41,7 +42,7 @@
 @APICommand(name = "stopInternalLoadBalancerVM", description = "Stops an Internal LB vm.", responseObject = DomainRouterResponse.class, entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class StopInternalLBVMCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(StopInternalLBVMCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(StopInternalLBVMCmd.class.getName());
     private static final String s_name = "stopinternallbvmresponse";
 
     // ///////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/iso/AttachIsoCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/iso/AttachIsoCmdByAdmin.java
index 2a585081a7a..2ee20ac73ee 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/iso/AttachIsoCmdByAdmin.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/iso/AttachIsoCmdByAdmin.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.iso;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiErrorCode;
@@ -32,7 +33,7 @@
 @APICommand(name = "attachIso", description = "Attaches an ISO to a virtual machine.", responseObject = UserVmResponse.class, responseView = ResponseView.Full,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class AttachIsoCmdByAdmin extends AttachIsoCmd {
-    public static final Logger s_logger = Logger.getLogger(AttachIsoCmdByAdmin.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(AttachIsoCmdByAdmin.class.getName());
 
     @Override
     public void execute(){
diff --git a/api/src/org/apache/cloudstack/api/command/admin/iso/DetachIsoCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/iso/DetachIsoCmdByAdmin.java
index 2486680c0bc..76d40cb0484 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/iso/DetachIsoCmdByAdmin.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/iso/DetachIsoCmdByAdmin.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.iso;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiErrorCode;
@@ -31,7 +32,7 @@
 @APICommand(name = "detachIso", description = "Detaches any ISO file (if any) currently attached to a virtual machine.", responseObject = UserVmResponse.class, responseView = ResponseView.Full,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class DetachIsoCmdByAdmin extends DetachIsoCmd {
-    public static final Logger s_logger = Logger.getLogger(DetachIsoCmdByAdmin.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DetachIsoCmdByAdmin.class.getName());
 
     @Override
     public void execute(){
diff --git a/api/src/org/apache/cloudstack/api/command/admin/iso/RegisterIsoCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/iso/RegisterIsoCmdByAdmin.java
index daae95980e3..f71645fa466 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/iso/RegisterIsoCmdByAdmin.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/iso/RegisterIsoCmdByAdmin.java
@@ -18,7 +18,8 @@
 
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiErrorCode;
@@ -34,7 +35,7 @@
 @APICommand(name = "registerIso", responseObject = TemplateResponse.class, description = "Registers an existing ISO into the CloudStack Cloud.", responseView = ResponseView.Full,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class RegisterIsoCmdByAdmin extends RegisterIsoCmd {
-    public static final Logger s_logger = Logger.getLogger(RegisterIsoCmdByAdmin.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(RegisterIsoCmdByAdmin.class.getName());
 
 
     @Override
diff --git a/api/src/org/apache/cloudstack/api/command/admin/iso/UpdateIsoCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/iso/UpdateIsoCmdByAdmin.java
index d3ec820a41c..92ad22bc6e7 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/iso/UpdateIsoCmdByAdmin.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/iso/UpdateIsoCmdByAdmin.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.iso;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiErrorCode;
@@ -30,7 +31,7 @@
 @APICommand(name = "updateIso", description = "Updates an ISO file.", responseObject = TemplateResponse.class, responseView = ResponseView.Full,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateIsoCmdByAdmin extends UpdateIsoCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateIsoCmdByAdmin.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateIsoCmdByAdmin.class.getName());
 
     @Override
     public void execute(){
diff --git a/api/src/org/apache/cloudstack/api/command/admin/loadbalancer/ListLoadBalancerRuleInstancesCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/loadbalancer/ListLoadBalancerRuleInstancesCmdByAdmin.java
index 1bece181fb8..8ba5982713f 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/loadbalancer/ListLoadBalancerRuleInstancesCmdByAdmin.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/loadbalancer/ListLoadBalancerRuleInstancesCmdByAdmin.java
@@ -21,7 +21,8 @@
 
 import com.cloud.vm.VirtualMachine;
 import org.apache.cloudstack.api.response.LoadBalancerRuleVmMapResponse;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ResponseObject.ResponseView;
@@ -36,7 +37,7 @@
         requestHasSensitiveInfo = false,
         responseHasSensitiveInfo = true)
 public class ListLoadBalancerRuleInstancesCmdByAdmin extends ListLoadBalancerRuleInstancesCmd {
-    public static final Logger s_logger = Logger.getLogger (ListLoadBalancerRuleInstancesCmdByAdmin.class.getName());
+    public static final Logger s_logger = LogManager.getLogger (ListLoadBalancerRuleInstancesCmdByAdmin.class.getName());
 
 
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/AddNetworkDeviceCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/AddNetworkDeviceCmd.java
index 68c43c449e2..32116f5ff3b 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/AddNetworkDeviceCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/AddNetworkDeviceCmd.java
@@ -20,7 +20,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -44,7 +45,7 @@
             responseObject = NetworkDeviceResponse.class,
             requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class AddNetworkDeviceCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(AddNetworkDeviceCmd.class);
+    public static final Logger s_logger = LogManager.getLogger(AddNetworkDeviceCmd.class);
     private static final String s_name = "addnetworkdeviceresponse";
 
     // ///////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/AddNetworkServiceProviderCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/AddNetworkServiceProviderCmd.java
index bb87015da78..64896a04f3b 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/AddNetworkServiceProviderCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/AddNetworkServiceProviderCmd.java
@@ -18,7 +18,8 @@
 
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -43,7 +44,7 @@
             requestHasSensitiveInfo = false,
             responseHasSensitiveInfo = false)
 public class AddNetworkServiceProviderCmd extends BaseAsyncCreateCmd {
-    public static final Logger s_logger = Logger.getLogger(AddNetworkServiceProviderCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(AddNetworkServiceProviderCmd.class.getName());
 
     private static final String s_name = "addnetworkserviceproviderresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/CreateNetworkCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/network/CreateNetworkCmdByAdmin.java
index 6d346e9a4db..f38e73b322d 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/CreateNetworkCmdByAdmin.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/CreateNetworkCmdByAdmin.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.network;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -35,7 +36,7 @@
 @APICommand(name = "createNetwork", description = "Creates a network", responseObject = NetworkResponse.class, responseView = ResponseView.Full, entityType = {Network.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreateNetworkCmdByAdmin extends CreateNetworkCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateNetworkCmdByAdmin.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateNetworkCmdByAdmin.class.getName());
 
     @Parameter(name=ApiConstants.VLAN, type=CommandType.STRING, description="the ID or VID of the network")
     private String vlan;
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/CreateNetworkOfferingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/CreateNetworkOfferingCmd.java
index 259c4905ed1..001f48fdfb1 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/CreateNetworkOfferingCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/CreateNetworkOfferingCmd.java
@@ -23,7 +23,8 @@
 import java.util.List;
 import java.util.Map;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -44,7 +45,7 @@
 @APICommand(name = "createNetworkOffering", description = "Creates a network offering.", responseObject = NetworkOfferingResponse.class, since = "3.0.0",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreateNetworkOfferingCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateNetworkOfferingCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateNetworkOfferingCmd.class.getName());
     private static final String s_name = "createnetworkofferingresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/CreatePhysicalNetworkCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/CreatePhysicalNetworkCmd.java
index c691a18c835..8309b686e69 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/CreatePhysicalNetworkCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/CreatePhysicalNetworkCmd.java
@@ -18,7 +18,8 @@
 
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -40,7 +41,7 @@
 @APICommand(name = "createPhysicalNetwork", description = "Creates a physical network", responseObject = PhysicalNetworkResponse.class, since = "3.0.0",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreatePhysicalNetworkCmd extends BaseAsyncCreateCmd {
-    public static final Logger s_logger = Logger.getLogger(CreatePhysicalNetworkCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreatePhysicalNetworkCmd.class.getName());
 
     private static final String s_name = "createphysicalnetworkresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/CreateStorageNetworkIpRangeCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/CreateStorageNetworkIpRangeCmd.java
index e9fbc6dd62d..6f4b2a92d01 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/CreateStorageNetworkIpRangeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/CreateStorageNetworkIpRangeCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.network;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -42,7 +43,7 @@
             requestHasSensitiveInfo = false,
             responseHasSensitiveInfo = false)
 public class CreateStorageNetworkIpRangeCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateStorageNetworkIpRangeCmd.class);
+    public static final Logger s_logger = LogManager.getLogger(CreateStorageNetworkIpRangeCmd.class);
 
     private static final String s_name = "createstoragenetworkiprangeresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/DedicateGuestVlanRangeCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/DedicateGuestVlanRangeCmd.java
index ba7b4b99c25..0eec201aaa2 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/DedicateGuestVlanRangeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/DedicateGuestVlanRangeCmd.java
@@ -18,7 +18,8 @@
  */
 package org.apache.cloudstack.api.command.admin.network;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -39,7 +40,7 @@
 @APICommand(name = "dedicateGuestVlanRange", description = "Dedicates a guest vlan range to an account", responseObject = GuestVlanRangeResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DedicateGuestVlanRangeCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(DedicateGuestVlanRangeCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DedicateGuestVlanRangeCmd.class.getName());
 
     private static final String s_name = "dedicateguestvlanrangeresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/DeleteNetworkDeviceCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/DeleteNetworkDeviceCmd.java
index abd9c11e7f0..d266734eaea 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/DeleteNetworkDeviceCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/DeleteNetworkDeviceCmd.java
@@ -18,7 +18,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -40,7 +41,7 @@
 @APICommand(name = "deleteNetworkDevice", description = "Deletes network device.", responseObject = SuccessResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteNetworkDeviceCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteNetworkDeviceCmd.class);
+    public static final Logger s_logger = LogManager.getLogger(DeleteNetworkDeviceCmd.class);
     private static final String s_name = "deletenetworkdeviceresponse";
 
     @Inject
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/DeleteNetworkOfferingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/DeleteNetworkOfferingCmd.java
index 62de3dd1752..1ba62537b3e 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/DeleteNetworkOfferingCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/DeleteNetworkOfferingCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.network;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -32,7 +33,7 @@
 @APICommand(name = "deleteNetworkOffering", description = "Deletes a network offering.", responseObject = SuccessResponse.class, since = "3.0.0",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteNetworkOfferingCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteNetworkOfferingCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteNetworkOfferingCmd.class.getName());
     private static final String s_name = "deletenetworkofferingresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/DeleteNetworkServiceProviderCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/DeleteNetworkServiceProviderCmd.java
index 9df27d3e06c..ac08dc8d146 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/DeleteNetworkServiceProviderCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/DeleteNetworkServiceProviderCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.network;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -36,7 +37,7 @@
 @APICommand(name = "deleteNetworkServiceProvider", description = "Deletes a Network Service Provider.", responseObject = SuccessResponse.class, since = "3.0.0",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteNetworkServiceProviderCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteNetworkServiceProviderCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteNetworkServiceProviderCmd.class.getName());
 
     private static final String s_name = "deletenetworkserviceproviderresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/DeletePhysicalNetworkCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/DeletePhysicalNetworkCmd.java
index 4d8c44628d3..c9e0551f466 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/DeletePhysicalNetworkCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/DeletePhysicalNetworkCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.network;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -35,7 +36,7 @@
 @APICommand(name = "deletePhysicalNetwork", description = "Deletes a Physical Network.", responseObject = SuccessResponse.class, since = "3.0.0",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeletePhysicalNetworkCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DeletePhysicalNetworkCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeletePhysicalNetworkCmd.class.getName());
 
     private static final String s_name = "deletephysicalnetworkresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/DeleteStorageNetworkIpRangeCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/DeleteStorageNetworkIpRangeCmd.java
index c4317278af6..e6d3b843586 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/DeleteStorageNetworkIpRangeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/DeleteStorageNetworkIpRangeCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.network;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -37,7 +38,7 @@
 @APICommand(name = "deleteStorageNetworkIpRange", description = "Deletes a storage network IP Range.", responseObject = SuccessResponse.class, since = "3.0.0",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteStorageNetworkIpRangeCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteStorageNetworkIpRangeCmd.class);
+    public static final Logger s_logger = LogManager.getLogger(DeleteStorageNetworkIpRangeCmd.class);
 
     private static final String s_name = "deletestoragenetworkiprangeresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/ListDedicatedGuestVlanRangesCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/ListDedicatedGuestVlanRangesCmd.java
index 9b1935c1d5a..783dfccec5c 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/ListDedicatedGuestVlanRangesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/ListDedicatedGuestVlanRangesCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -39,7 +40,7 @@
 @APICommand(name = "listDedicatedGuestVlanRanges", description = "Lists dedicated guest vlan ranges", responseObject = GuestVlanRangeResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListDedicatedGuestVlanRangesCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListDedicatedGuestVlanRangesCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListDedicatedGuestVlanRangesCmd.class.getName());
 
     private static final String s_name = "listdedicatedguestvlanrangesresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/ListNetworkDeviceCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/ListNetworkDeviceCmd.java
index 405c2654bdf..03b089e070e 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/ListNetworkDeviceCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/ListNetworkDeviceCmd.java
@@ -22,7 +22,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -45,7 +46,7 @@
 @APICommand(name = "listNetworkDevice", description = "List network devices", responseObject = NetworkDeviceResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListNetworkDeviceCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListNetworkDeviceCmd.class);
+    public static final Logger s_logger = LogManager.getLogger(ListNetworkDeviceCmd.class);
     private static final String s_name = "listnetworkdevice";
 
     @Inject
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/ListNetworkServiceProvidersCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/ListNetworkServiceProvidersCmd.java
index 94b859716e4..9ee982b0a54 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/ListNetworkServiceProvidersCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/ListNetworkServiceProvidersCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -40,7 +41,7 @@
             requestHasSensitiveInfo = false,
             responseHasSensitiveInfo = false)
 public class ListNetworkServiceProvidersCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListNetworkServiceProvidersCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListNetworkServiceProvidersCmd.class.getName());
     private static final String Name = "listnetworkserviceprovidersresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/ListNetworksCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/network/ListNetworksCmdByAdmin.java
index 244352f51b5..601c7e2b930 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/ListNetworksCmdByAdmin.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/ListNetworksCmdByAdmin.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ResponseObject.ResponseView;
@@ -33,7 +34,7 @@
 @APICommand(name = "listNetworks", description = "Lists all available networks.", responseObject = NetworkResponse.class, responseView = ResponseView.Full, entityType = {Network.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListNetworksCmdByAdmin extends ListNetworksCmd {
-    public static final Logger s_logger = Logger.getLogger(ListNetworksCmdByAdmin.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListNetworksCmdByAdmin.class.getName());
 
     @Override
     public void execute(){
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/ListPhysicalNetworksCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/ListPhysicalNetworksCmd.java
index e495fd6a398..29401466331 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/ListPhysicalNetworksCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/ListPhysicalNetworksCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -38,7 +39,7 @@
 @APICommand(name = "listPhysicalNetworks", description = "Lists physical networks", responseObject = PhysicalNetworkResponse.class, since = "3.0.0",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListPhysicalNetworksCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListPhysicalNetworksCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListPhysicalNetworksCmd.class.getName());
 
     private static final String s_name = "listphysicalnetworksresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/ListStorageNetworkIpRangeCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/ListStorageNetworkIpRangeCmd.java
index b3f8b8197a4..94ea5616461 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/ListStorageNetworkIpRangeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/ListStorageNetworkIpRangeCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -42,7 +43,7 @@
 @APICommand(name = "listStorageNetworkIpRange", description = "List a storage network IP range.", responseObject = StorageNetworkIpRangeResponse.class, since = "3.0.0",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListStorageNetworkIpRangeCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListStorageNetworkIpRangeCmd.class);
+    public static final Logger s_logger = LogManager.getLogger(ListStorageNetworkIpRangeCmd.class);
 
     String _name = "liststoragenetworkiprangeresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/ListSupportedNetworkServicesCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/ListSupportedNetworkServicesCmd.java
index 39e99a43a6c..1bc4e506b4d 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/ListSupportedNetworkServicesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/ListSupportedNetworkServicesCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -40,7 +41,7 @@
             requestHasSensitiveInfo = false,
             responseHasSensitiveInfo = false)
 public class ListSupportedNetworkServicesCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListSupportedNetworkServicesCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListSupportedNetworkServicesCmd.class.getName());
     private static final String s_name = "listsupportednetworkservicesresponse";
 
     @Parameter(name = ApiConstants.PROVIDER, type = CommandType.STRING, description = "network service provider name")
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/ReleaseDedicatedGuestVlanRangeCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/ReleaseDedicatedGuestVlanRangeCmd.java
index 263d46a7509..4f326e1c167 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/ReleaseDedicatedGuestVlanRangeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/ReleaseDedicatedGuestVlanRangeCmd.java
@@ -17,7 +17,8 @@
 
 package org.apache.cloudstack.api.command.admin.network;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -36,7 +37,7 @@
 @APICommand(name = "releaseDedicatedGuestVlanRange", description = "Releases a dedicated guest vlan range to the system", responseObject = SuccessResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ReleaseDedicatedGuestVlanRangeCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(ReleaseDedicatedGuestVlanRangeCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ReleaseDedicatedGuestVlanRangeCmd.class.getName());
     private static final String s_name = "releasededicatedguestvlanrangeresponse";
 
     // ///////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/UpdateNetworkCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/network/UpdateNetworkCmdByAdmin.java
index 388348c592c..39581b2d45d 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/UpdateNetworkCmdByAdmin.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/UpdateNetworkCmdByAdmin.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.network;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiErrorCode;
@@ -36,7 +37,7 @@
 @APICommand(name = "updateNetwork", description = "Updates a network", responseObject = NetworkResponse.class, responseView = ResponseView.Full, entityType = {Network.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateNetworkCmdByAdmin extends UpdateNetworkCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateNetworkCmdByAdmin.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateNetworkCmdByAdmin.class.getName());
 
 
     @Override
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/UpdateNetworkOfferingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/UpdateNetworkOfferingCmd.java
index 411da4fd36b..e332e993db3 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/UpdateNetworkOfferingCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/UpdateNetworkOfferingCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.network;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -32,7 +33,7 @@
 @APICommand(name = "updateNetworkOffering", description = "Updates a network offering.", responseObject = NetworkOfferingResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateNetworkOfferingCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateNetworkOfferingCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateNetworkOfferingCmd.class.getName());
     private static final String s_name = "updatenetworkofferingresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/UpdateNetworkServiceProviderCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/UpdateNetworkServiceProviderCmd.java
index bb4f64e0400..f67e6f208a1 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/UpdateNetworkServiceProviderCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/UpdateNetworkServiceProviderCmd.java
@@ -18,7 +18,8 @@
 
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -40,7 +41,7 @@
             requestHasSensitiveInfo = false,
             responseHasSensitiveInfo = false)
 public class UpdateNetworkServiceProviderCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateNetworkServiceProviderCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateNetworkServiceProviderCmd.class.getName());
 
     private static final String s_name = "updatenetworkserviceproviderresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/UpdatePhysicalNetworkCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/UpdatePhysicalNetworkCmd.java
index ed3fa97ce7a..82cb395d5b7 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/UpdatePhysicalNetworkCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/UpdatePhysicalNetworkCmd.java
@@ -18,7 +18,8 @@
 
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -34,7 +35,7 @@
 @APICommand(name = "updatePhysicalNetwork", description = "Updates a physical network", responseObject = PhysicalNetworkResponse.class, since = "3.0.0",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdatePhysicalNetworkCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdatePhysicalNetworkCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdatePhysicalNetworkCmd.class.getName());
 
     private static final String s_name = "updatephysicalnetworkresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/UpdateStorageNetworkIpRangeCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/UpdateStorageNetworkIpRangeCmd.java
index d82c28d1bff..6877a2723d2 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/UpdateStorageNetworkIpRangeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/UpdateStorageNetworkIpRangeCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.network;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -41,7 +42,7 @@
             requestHasSensitiveInfo = false,
             responseHasSensitiveInfo = false)
 public class UpdateStorageNetworkIpRangeCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateStorageNetworkIpRangeCmd.class);
+    public static final Logger s_logger = LogManager.getLogger(UpdateStorageNetworkIpRangeCmd.class);
     private static final String s_name = "updatestoragenetworkiprangeresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/offering/CreateDiskOfferingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/offering/CreateDiskOfferingCmd.java
index 747da053be6..435b4a05362 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/offering/CreateDiskOfferingCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/offering/CreateDiskOfferingCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.offering;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -35,7 +36,7 @@
 @APICommand(name = "createDiskOffering", description = "Creates a disk offering.", responseObject = DiskOfferingResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreateDiskOfferingCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateDiskOfferingCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateDiskOfferingCmd.class.getName());
 
     private static final String s_name = "creatediskofferingresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java
index 0bde79bbd7b..f58b869def9 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java
@@ -30,7 +30,8 @@
 import org.apache.cloudstack.api.ServerApiException;
 import org.apache.cloudstack.api.response.DomainResponse;
 import org.apache.cloudstack.api.response.ServiceOfferingResponse;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.offering.ServiceOffering;
 import com.cloud.user.Account;
@@ -38,7 +39,7 @@
 @APICommand(name = "createServiceOffering", description = "Creates a service offering.", responseObject = ServiceOfferingResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreateServiceOfferingCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateServiceOfferingCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateServiceOfferingCmd.class.getName());
     private static final String s_name = "createserviceofferingresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/offering/DeleteDiskOfferingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/offering/DeleteDiskOfferingCmd.java
index 8987d50066e..0ab15760323 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/offering/DeleteDiskOfferingCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/offering/DeleteDiskOfferingCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.offering;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -32,7 +33,7 @@
 @APICommand(name = "deleteDiskOffering", description = "Updates a disk offering.", responseObject = SuccessResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteDiskOfferingCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteDiskOfferingCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteDiskOfferingCmd.class.getName());
     private static final String s_name = "deletediskofferingresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/offering/DeleteServiceOfferingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/offering/DeleteServiceOfferingCmd.java
index 2a07fff9b15..76999afb577 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/offering/DeleteServiceOfferingCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/offering/DeleteServiceOfferingCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.offering;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -32,7 +33,7 @@
 @APICommand(name = "deleteServiceOffering", description = "Deletes a service offering.", responseObject = SuccessResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteServiceOfferingCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteServiceOfferingCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteServiceOfferingCmd.class.getName());
     private static final String s_name = "deleteserviceofferingresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/offering/UpdateDiskOfferingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/offering/UpdateDiskOfferingCmd.java
index 6e1fde55a30..9b64ee4dbaf 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/offering/UpdateDiskOfferingCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/offering/UpdateDiskOfferingCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.offering;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -32,7 +33,7 @@
 @APICommand(name = "updateDiskOffering", description = "Updates a disk offering.", responseObject = DiskOfferingResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateDiskOfferingCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateDiskOfferingCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateDiskOfferingCmd.class.getName());
     private static final String s_name = "updatediskofferingresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/offering/UpdateServiceOfferingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/offering/UpdateServiceOfferingCmd.java
index f4f4bdfac88..56eb1c80d1c 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/offering/UpdateServiceOfferingCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/offering/UpdateServiceOfferingCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.offering;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -32,7 +33,7 @@
 @APICommand(name = "updateServiceOffering", description = "Updates a service offering.", responseObject = ServiceOfferingResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateServiceOfferingCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateServiceOfferingCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateServiceOfferingCmd.class.getName());
     private static final String s_name = "updateserviceofferingresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/pod/CreatePodCmd.java b/api/src/org/apache/cloudstack/api/command/admin/pod/CreatePodCmd.java
index d912b44132f..8fa0e4148ef 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/pod/CreatePodCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/pod/CreatePodCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.pod;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -33,7 +34,7 @@
 @APICommand(name = "createPod", description = "Creates a new Pod.", responseObject = PodResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreatePodCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(CreatePodCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreatePodCmd.class.getName());
 
     private static final String s_name = "createpodresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/pod/DeletePodCmd.java b/api/src/org/apache/cloudstack/api/command/admin/pod/DeletePodCmd.java
index c2edacba353..817f984861b 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/pod/DeletePodCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/pod/DeletePodCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.pod;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -32,7 +33,7 @@
 @APICommand(name = "deletePod", description = "Deletes a Pod.", responseObject = SuccessResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeletePodCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(DeletePodCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeletePodCmd.class.getName());
 
     private static final String s_name = "deletepodresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/pod/ListPodsByCmd.java b/api/src/org/apache/cloudstack/api/command/admin/pod/ListPodsByCmd.java
index 3cc03f24d7c..bb8790d53e5 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/pod/ListPodsByCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/pod/ListPodsByCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -35,7 +36,7 @@
 @APICommand(name = "listPods", description = "Lists all Pods.", responseObject = PodResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListPodsByCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListPodsByCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListPodsByCmd.class.getName());
 
     private static final String s_name = "listpodsresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/pod/UpdatePodCmd.java b/api/src/org/apache/cloudstack/api/command/admin/pod/UpdatePodCmd.java
index c89694c56bb..0f5b3a65850 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/pod/UpdatePodCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/pod/UpdatePodCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.pod;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -32,7 +33,7 @@
 @APICommand(name = "updatePod", description = "Updates a Pod.", responseObject = PodResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdatePodCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdatePodCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdatePodCmd.class.getName());
 
     private static final String s_name = "updatepodresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/region/AddRegionCmd.java b/api/src/org/apache/cloudstack/api/command/admin/region/AddRegionCmd.java
index f6743baf625..25142d0e2ff 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/region/AddRegionCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/region/AddRegionCmd.java
@@ -18,7 +18,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -35,7 +36,7 @@
 @APICommand(name = "addRegion", description = "Adds a Region", responseObject = RegionResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class AddRegionCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(AddRegionCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(AddRegionCmd.class.getName());
 
     private static final String s_name = "addregionresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/region/CreatePortableIpRangeCmd.java b/api/src/org/apache/cloudstack/api/command/admin/region/CreatePortableIpRangeCmd.java
index 403eaf3e39a..44565afabe0 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/region/CreatePortableIpRangeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/region/CreatePortableIpRangeCmd.java
@@ -17,7 +17,8 @@
 
 package org.apache.cloudstack.api.command.admin.region;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -43,7 +44,7 @@
             responseHasSensitiveInfo = false)
 public class CreatePortableIpRangeCmd extends BaseAsyncCreateCmd {
 
-    public static final Logger s_logger = Logger.getLogger(CreatePortableIpRangeCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreatePortableIpRangeCmd.class.getName());
 
     private static final String s_name = "createportableiprangeresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/region/DeletePortableIpRangeCmd.java b/api/src/org/apache/cloudstack/api/command/admin/region/DeletePortableIpRangeCmd.java
index 413818b8242..0ed1d44dde7 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/region/DeletePortableIpRangeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/region/DeletePortableIpRangeCmd.java
@@ -17,7 +17,8 @@
 
 package org.apache.cloudstack.api.command.admin.region;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -35,7 +36,7 @@
 @APICommand(name = "deletePortableIpRange", description = "deletes a range of portable public IP's associated with a region", responseObject = SuccessResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeletePortableIpRangeCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DeletePortableIpRangeCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeletePortableIpRangeCmd.class.getName());
 
     private static final String s_name = "deleteportablepublicipresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/region/ListPortableIpRangesCmd.java b/api/src/org/apache/cloudstack/api/command/admin/region/ListPortableIpRangesCmd.java
index ed0ddd68aca..9b81f56591f 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/region/ListPortableIpRangesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/region/ListPortableIpRangesCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -37,7 +38,7 @@
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListPortableIpRangesCmd extends BaseListCmd {
 
-    public static final Logger s_logger = Logger.getLogger(ListPortableIpRangesCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListPortableIpRangesCmd.class.getName());
 
     private static final String s_name = "listportableipresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/region/RemoveRegionCmd.java b/api/src/org/apache/cloudstack/api/command/admin/region/RemoveRegionCmd.java
index 415456f9414..8fe3f4ed5ac 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/region/RemoveRegionCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/region/RemoveRegionCmd.java
@@ -18,7 +18,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -34,7 +35,7 @@
 @APICommand(name = "removeRegion", description = "Removes specified region", responseObject = SuccessResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class RemoveRegionCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(RemoveRegionCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(RemoveRegionCmd.class.getName());
     private static final String s_name = "removeregionresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/region/UpdateRegionCmd.java b/api/src/org/apache/cloudstack/api/command/admin/region/UpdateRegionCmd.java
index b08cbbbb10c..cbbab77f784 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/region/UpdateRegionCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/region/UpdateRegionCmd.java
@@ -18,7 +18,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -35,7 +36,7 @@
 @APICommand(name = "updateRegion", description = "Updates a region", responseObject = RegionResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateRegionCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateRegionCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateRegionCmd.class.getName());
     private static final String s_name = "updateregionresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/resource/ArchiveAlertsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/resource/ArchiveAlertsCmd.java
index 79b3520b0b4..26d167d5a85 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/resource/ArchiveAlertsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/resource/ArchiveAlertsCmd.java
@@ -19,7 +19,8 @@
 import java.util.Date;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -37,7 +38,7 @@
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ArchiveAlertsCmd extends BaseCmd {
 
-    public static final Logger s_logger = Logger.getLogger(ArchiveAlertsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ArchiveAlertsCmd.class.getName());
 
     private static final String s_name = "archivealertsresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/resource/CleanVMReservationsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/resource/CleanVMReservationsCmd.java
index 9acc71ce693..35eb4d3eb8b 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/resource/CleanVMReservationsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/resource/CleanVMReservationsCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.resource;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiErrorCode;
@@ -31,7 +32,7 @@
 @APICommand(name = "cleanVMReservations", description = "Cleanups VM reservations in the database.", responseObject = SuccessResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CleanVMReservationsCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(CleanVMReservationsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CleanVMReservationsCmd.class.getName());
 
     private static final String s_name = "cleanvmreservationresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/resource/DeleteAlertsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/resource/DeleteAlertsCmd.java
index 246b25785b3..3c849ff9b38 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/resource/DeleteAlertsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/resource/DeleteAlertsCmd.java
@@ -19,7 +19,8 @@
 import java.util.Date;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -37,7 +38,7 @@
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteAlertsCmd extends BaseCmd {
 
-    public static final Logger s_logger = Logger.getLogger(DeleteAlertsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteAlertsCmd.class.getName());
 
     private static final String s_name = "deletealertsresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/resource/ListAlertsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/resource/ListAlertsCmd.java
index 8f21263b85c..2ccea14e5c4 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/resource/ListAlertsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/resource/ListAlertsCmd.java
@@ -25,7 +25,8 @@
 import org.apache.cloudstack.api.Parameter;
 import org.apache.cloudstack.api.response.AlertResponse;
 import org.apache.cloudstack.api.response.ListResponse;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.alert.Alert;
 import com.cloud.utils.Pair;
@@ -34,7 +35,7 @@
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListAlertsCmd extends BaseListCmd {
 
-    public static final Logger s_logger = Logger.getLogger(ListAlertsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListAlertsCmd.class.getName());
 
     private static final String s_name = "listalertsresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/resource/ListCapacityCmd.java b/api/src/org/apache/cloudstack/api/command/admin/resource/ListCapacityCmd.java
index 76ca3a79b11..c4444db243a 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/resource/ListCapacityCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/resource/ListCapacityCmd.java
@@ -21,7 +21,8 @@
 import java.util.Comparator;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -40,7 +41,7 @@
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListCapacityCmd extends BaseListCmd {
 
-    public static final Logger s_logger = Logger.getLogger(ListCapacityCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListCapacityCmd.class.getName());
     private static final DecimalFormat s_percentFormat = new DecimalFormat("##.##");
 
     private static final String s_name = "listcapacityresponse";
diff --git a/api/src/org/apache/cloudstack/api/command/admin/resource/UploadCustomCertificateCmd.java b/api/src/org/apache/cloudstack/api/command/admin/resource/UploadCustomCertificateCmd.java
index e8d6cc55d6d..cc142d1f8a3 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/resource/UploadCustomCertificateCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/resource/UploadCustomCertificateCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.resource;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -34,7 +35,7 @@
             description = "Uploads a custom certificate for the console proxy VMs to use for SSL. Can be used to upload a single certificate signed by a known CA. Can also be used, through multiple calls, to upload a chain of certificates from CA to the custom certificate itself.",
             requestHasSensitiveInfo = true, responseHasSensitiveInfo = false)
 public class UploadCustomCertificateCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(UploadCustomCertificateCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UploadCustomCertificateCmd.class.getName());
 
     private static final String s_name = "uploadcustomcertificateresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/router/ConfigureOvsElementCmd.java b/api/src/org/apache/cloudstack/api/command/admin/router/ConfigureOvsElementCmd.java
index 7577f2eb884..6811e5c6331 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/router/ConfigureOvsElementCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/router/ConfigureOvsElementCmd.java
@@ -29,7 +29,8 @@
 import org.apache.cloudstack.api.ServerApiException;
 import org.apache.cloudstack.api.response.OvsProviderResponse;
 import org.apache.cloudstack.context.CallContext;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.event.EventTypes;
 import com.cloud.exception.ConcurrentOperationException;
@@ -42,8 +43,7 @@
 @APICommand(name = "configureOvsElement", responseObject = OvsProviderResponse.class, description = "Configures an ovs element.",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ConfigureOvsElementCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger
-        .getLogger(ConfigureOvsElementCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ConfigureOvsElementCmd.class.getName());
     private static final String s_name = "configureovselementresponse";
     @Inject
     private List<VirtualRouterElementService> _service;
diff --git a/api/src/org/apache/cloudstack/api/command/admin/router/ConfigureVirtualRouterElementCmd.java b/api/src/org/apache/cloudstack/api/command/admin/router/ConfigureVirtualRouterElementCmd.java
index 6dd05a48b71..5bb12334652 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/router/ConfigureVirtualRouterElementCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/router/ConfigureVirtualRouterElementCmd.java
@@ -20,7 +20,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -43,7 +44,7 @@
 @APICommand(name = "configureVirtualRouterElement", responseObject = VirtualRouterProviderResponse.class, description = "Configures a virtual router element.",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ConfigureVirtualRouterElementCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(ConfigureVirtualRouterElementCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ConfigureVirtualRouterElementCmd.class.getName());
     private static final String s_name = "configurevirtualrouterelementresponse";
 
     @Inject
diff --git a/api/src/org/apache/cloudstack/api/command/admin/router/CreateVirtualRouterElementCmd.java b/api/src/org/apache/cloudstack/api/command/admin/router/CreateVirtualRouterElementCmd.java
index 10cf00f987b..9749f5a4844 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/router/CreateVirtualRouterElementCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/router/CreateVirtualRouterElementCmd.java
@@ -20,7 +20,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -43,7 +44,7 @@
 @APICommand(name = "createVirtualRouterElement", responseObject = VirtualRouterProviderResponse.class, description = "Create a virtual router element.",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreateVirtualRouterElementCmd extends BaseAsyncCreateCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateVirtualRouterElementCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateVirtualRouterElementCmd.class.getName());
     private static final String s_name = "createvirtualrouterelementresponse";
 
     @Inject
diff --git a/api/src/org/apache/cloudstack/api/command/admin/router/DestroyRouterCmd.java b/api/src/org/apache/cloudstack/api/command/admin/router/DestroyRouterCmd.java
index 4513e2e85e2..add4bdc22b1 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/router/DestroyRouterCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/router/DestroyRouterCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.router;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -38,7 +39,7 @@
 @APICommand(name = "destroyRouter", description = "Destroys a router.", responseObject = DomainRouterResponse.class, entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DestroyRouterCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DestroyRouterCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DestroyRouterCmd.class.getName());
     private static final String s_name = "destroyrouterresponse";
 
     // ///////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/router/ListOvsElementsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/router/ListOvsElementsCmd.java
index 75c69564188..fbc60830421 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/router/ListOvsElementsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/router/ListOvsElementsCmd.java
@@ -30,7 +30,8 @@
 import org.apache.cloudstack.api.response.ListResponse;
 import org.apache.cloudstack.api.response.OvsProviderResponse;
 import org.apache.cloudstack.api.response.ProviderResponse;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.exception.ConcurrentOperationException;
 import com.cloud.exception.InsufficientCapacityException;
@@ -42,8 +43,7 @@
 @APICommand(name = "listOvsElements", description = "Lists all available ovs elements.", responseObject = OvsProviderResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListOvsElementsCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger
-        .getLogger(ListNetworkOfferingsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListNetworkOfferingsCmd.class.getName());
     private static final String Name = "listovselementsresponse";
     @Inject
     private List<VirtualRouterElementService> _service;
diff --git a/api/src/org/apache/cloudstack/api/command/admin/router/ListRoutersCmd.java b/api/src/org/apache/cloudstack/api/command/admin/router/ListRoutersCmd.java
index 121fc5bc14d..37180bdecd5 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/router/ListRoutersCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/router/ListRoutersCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.router;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -39,7 +40,7 @@
 @APICommand(name = "listRouters", description = "List routers.", responseObject = DomainRouterResponse.class, entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListRoutersCmd extends BaseListProjectAndAccountResourcesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListRoutersCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListRoutersCmd.class.getName());
 
     private static final String s_name = "listroutersresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/router/ListVirtualRouterElementsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/router/ListVirtualRouterElementsCmd.java
index 24bbf5ae2ed..523ec2a48df 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/router/ListVirtualRouterElementsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/router/ListVirtualRouterElementsCmd.java
@@ -21,7 +21,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -43,7 +44,7 @@
 @APICommand(name = "listVirtualRouterElements", description = "Lists all available virtual router elements.", responseObject = VirtualRouterProviderResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListVirtualRouterElementsCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListNetworkOfferingsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListNetworkOfferingsCmd.class.getName());
     private static final String s_name = "listvirtualrouterelementsresponse";
 
     // TODO, VirtualRouterElementServer is not singleton in system!
diff --git a/api/src/org/apache/cloudstack/api/command/admin/router/RebootRouterCmd.java b/api/src/org/apache/cloudstack/api/command/admin/router/RebootRouterCmd.java
index 4b138f3cfc1..4f72fe36c2b 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/router/RebootRouterCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/router/RebootRouterCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.router;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -39,7 +40,7 @@
 @APICommand(name = "rebootRouter", description = "Starts a router.", responseObject = DomainRouterResponse.class, entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class RebootRouterCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(RebootRouterCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(RebootRouterCmd.class.getName());
     private static final String s_name = "rebootrouterresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/router/StartRouterCmd.java b/api/src/org/apache/cloudstack/api/command/admin/router/StartRouterCmd.java
index 173833cb42c..05bbd9eb88f 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/router/StartRouterCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/router/StartRouterCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.router;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -41,7 +42,7 @@
 @APICommand(name = "startRouter", responseObject = DomainRouterResponse.class, description = "Starts a router.", entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class StartRouterCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(StartRouterCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(StartRouterCmd.class.getName());
     private static final String s_name = "startrouterresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/router/StopRouterCmd.java b/api/src/org/apache/cloudstack/api/command/admin/router/StopRouterCmd.java
index 2592cae545a..0f0bab96480 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/router/StopRouterCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/router/StopRouterCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.router;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -40,7 +41,7 @@
 @APICommand(name = "stopRouter", description = "Stops a router.", responseObject = DomainRouterResponse.class, entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class StopRouterCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(StopRouterCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(StopRouterCmd.class.getName());
     private static final String s_name = "stoprouterresponse";
 
     // ///////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/router/UpgradeRouterCmd.java b/api/src/org/apache/cloudstack/api/command/admin/router/UpgradeRouterCmd.java
index 067d344337b..70ef8ed142d 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/router/UpgradeRouterCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/router/UpgradeRouterCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.router;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -34,7 +35,7 @@
 @APICommand(name = "changeServiceForRouter", description = "Upgrades domain router to a new service offering", responseObject = DomainRouterResponse.class, entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpgradeRouterCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(UpgradeRouterCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpgradeRouterCmd.class.getName());
     private static final String s_name = "changeserviceforrouterresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/router/UpgradeRouterTemplateCmd.java b/api/src/org/apache/cloudstack/api/command/admin/router/UpgradeRouterTemplateCmd.java
index 65d26cc7f96..69970deda7d 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/router/UpgradeRouterTemplateCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/router/UpgradeRouterTemplateCmd.java
@@ -17,8 +17,11 @@
 package org.apache.cloudstack.api.command.admin.router;
 
 import java.util.List;
-import java.util.logging.Logger;
 
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.user.Account;
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
 import org.apache.cloudstack.api.ApiConstants;
@@ -34,16 +37,13 @@
 import org.apache.cloudstack.api.response.UpgradeRouterTemplateResponse;
 import org.apache.cloudstack.api.response.ZoneResponse;
 import org.apache.cloudstack.context.CallContext;
-
-import com.cloud.exception.ConcurrentOperationException;
-import com.cloud.exception.InsufficientCapacityException;
-import com.cloud.exception.ResourceUnavailableException;
-import com.cloud.user.Account;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 @APICommand(name = "upgradeRouterTemplate", description = "Upgrades router to use newer template", responseObject = BaseResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpgradeRouterTemplateCmd extends org.apache.cloudstack.api.BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(UpgradeRouterTemplateCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpgradeRouterTemplateCmd.class.getName());
     private static final String s_name = "upgraderoutertemplateresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/storage/AddImageStoreCmd.java b/api/src/org/apache/cloudstack/api/command/admin/storage/AddImageStoreCmd.java
index 839d64dcf9d..5dbc69bbe29 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/storage/AddImageStoreCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/storage/AddImageStoreCmd.java
@@ -21,7 +21,8 @@
 import java.util.Iterator;
 import java.util.Map;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -39,7 +40,7 @@
 @APICommand(name = "addImageStore", description = "Adds backup image store.", responseObject = ImageStoreResponse.class, since = "4.2.0",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class AddImageStoreCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(AddImageStoreCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(AddImageStoreCmd.class.getName());
     private static final String s_name = "addimagestoreresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/storage/AddImageStoreS3CMD.java b/api/src/org/apache/cloudstack/api/command/admin/storage/AddImageStoreS3CMD.java
index 34ff171b91f..4b9fd19c78d 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/storage/AddImageStoreS3CMD.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/storage/AddImageStoreS3CMD.java
@@ -38,7 +38,8 @@
 import java.util.Map;
 
 import com.cloud.utils.storage.S3.ClientOptions;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -59,7 +60,7 @@
 @APICommand(name = "addImageStoreS3", description = "Adds S3 Image Store", responseObject = ImageStoreResponse.class, since = "4.7.0",
         requestHasSensitiveInfo = true, responseHasSensitiveInfo = false)
 public final class AddImageStoreS3CMD extends BaseCmd implements ClientOptions {
-    public static final Logger s_logger = Logger.getLogger(AddImageStoreS3CMD.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(AddImageStoreS3CMD.class.getName());
 
     private static final String s_name = "addImageStoreS3Response";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/storage/CancelPrimaryStorageMaintenanceCmd.java b/api/src/org/apache/cloudstack/api/command/admin/storage/CancelPrimaryStorageMaintenanceCmd.java
index 91348ecf6b0..300cbe816dd 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/storage/CancelPrimaryStorageMaintenanceCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/storage/CancelPrimaryStorageMaintenanceCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.storage;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -36,7 +37,7 @@
 @APICommand(name = "cancelStorageMaintenance", description = "Cancels maintenance for primary storage", responseObject = StoragePoolResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CancelPrimaryStorageMaintenanceCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(CancelPrimaryStorageMaintenanceCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CancelPrimaryStorageMaintenanceCmd.class.getName());
 
     private static final String s_name = "cancelprimarystoragemaintenanceresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/storage/CreateSecondaryStagingStoreCmd.java b/api/src/org/apache/cloudstack/api/command/admin/storage/CreateSecondaryStagingStoreCmd.java
index 194179d7697..7e57a7ff15d 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/storage/CreateSecondaryStagingStoreCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/storage/CreateSecondaryStagingStoreCmd.java
@@ -21,7 +21,8 @@
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -38,7 +39,7 @@
 @APICommand(name = "createSecondaryStagingStore", description = "create secondary staging store.", responseObject = ImageStoreResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreateSecondaryStagingStoreCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(AddImageStoreCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(AddImageStoreCmd.class.getName());
     private static final String s_name = "createsecondarystagingstoreresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/storage/CreateStoragePoolCmd.java b/api/src/org/apache/cloudstack/api/command/admin/storage/CreateStoragePoolCmd.java
index ae44bc93732..043eec04030 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/storage/CreateStoragePoolCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/storage/CreateStoragePoolCmd.java
@@ -19,7 +19,8 @@
 import java.net.UnknownHostException;
 import java.util.Map;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -41,7 +42,7 @@
 @APICommand(name = "createStoragePool", description = "Creates a storage pool.", responseObject = StoragePoolResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreateStoragePoolCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateStoragePoolCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateStoragePoolCmd.class.getName());
 
     private static final String s_name = "createstoragepoolresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/storage/DeleteImageStoreCmd.java b/api/src/org/apache/cloudstack/api/command/admin/storage/DeleteImageStoreCmd.java
index ad812adf0cb..f79fc881a78 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/storage/DeleteImageStoreCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/storage/DeleteImageStoreCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.storage;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -32,7 +33,7 @@
 @APICommand(name = "deleteImageStore", description = "Deletes an image store or Secondary Storage.", responseObject = SuccessResponse.class, since = "4.2.0",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteImageStoreCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteImageStoreCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteImageStoreCmd.class.getName());
 
     private static final String s_name = "deleteimagestoreresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/storage/DeletePoolCmd.java b/api/src/org/apache/cloudstack/api/command/admin/storage/DeletePoolCmd.java
index 5465fd1440f..b73cdd33acf 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/storage/DeletePoolCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/storage/DeletePoolCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.storage;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -34,7 +35,7 @@
 @APICommand(name = "deleteStoragePool", description = "Deletes a storage pool.", responseObject = SuccessResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeletePoolCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(DeletePoolCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeletePoolCmd.class.getName());
     private static final String s_name = "deletestoragepoolresponse";
 
     // ///////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/storage/DeleteSecondaryStagingStoreCmd.java b/api/src/org/apache/cloudstack/api/command/admin/storage/DeleteSecondaryStagingStoreCmd.java
index 16398623359..d1c3e10b03e 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/storage/DeleteSecondaryStagingStoreCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/storage/DeleteSecondaryStagingStoreCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.storage;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -32,7 +33,7 @@
 @APICommand(name = "deleteSecondaryStagingStore", description = "Deletes a secondary staging store .", responseObject = SuccessResponse.class, since = "4.2.0",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteSecondaryStagingStoreCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteSecondaryStagingStoreCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteSecondaryStagingStoreCmd.class.getName());
 
     private static final String s_name = "deletesecondarystagingstoreresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/storage/FindStoragePoolsForMigrationCmd.java b/api/src/org/apache/cloudstack/api/command/admin/storage/FindStoragePoolsForMigrationCmd.java
index 47fa965e7dd..aefb5f26bfa 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/storage/FindStoragePoolsForMigrationCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/storage/FindStoragePoolsForMigrationCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -36,7 +37,7 @@
 @APICommand(name = "findStoragePoolsForMigration", description = "Lists storage pools available for migration of a volume.", responseObject = StoragePoolResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class FindStoragePoolsForMigrationCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(FindStoragePoolsForMigrationCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(FindStoragePoolsForMigrationCmd.class.getName());
 
     private static final String s_name = "findstoragepoolsformigrationresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/storage/ListImageStoresCmd.java b/api/src/org/apache/cloudstack/api/command/admin/storage/ListImageStoresCmd.java
index 8c37c78c763..62da5688b98 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/storage/ListImageStoresCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/storage/ListImageStoresCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.storage;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -29,7 +30,7 @@
 @APICommand(name = "listImageStores", description = "Lists image stores.", responseObject = ImageStoreResponse.class, since = "4.2.0",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListImageStoresCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListImageStoresCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListImageStoresCmd.class.getName());
 
     private static final String s_name = "listimagestoresresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/storage/ListSecondaryStagingStoresCmd.java b/api/src/org/apache/cloudstack/api/command/admin/storage/ListSecondaryStagingStoresCmd.java
index e315c8a6d47..4bee8869ee1 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/storage/ListSecondaryStagingStoresCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/storage/ListSecondaryStagingStoresCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.storage;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -29,7 +30,7 @@
 @APICommand(name = "listSecondaryStagingStores", description = "Lists secondary staging stores.", responseObject = ImageStoreResponse.class, since = "4.2.0",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListSecondaryStagingStoresCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListSecondaryStagingStoresCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListSecondaryStagingStoresCmd.class.getName());
 
     private static final String s_name = "listsecondarystagingstoreresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/storage/ListStoragePoolsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/storage/ListStoragePoolsCmd.java
index ed123dbb6c3..8ef70daeed2 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/storage/ListStoragePoolsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/storage/ListStoragePoolsCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.storage;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -32,7 +33,7 @@
 @APICommand(name = "listStoragePools", description = "Lists storage pools.", responseObject = StoragePoolResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListStoragePoolsCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListStoragePoolsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListStoragePoolsCmd.class.getName());
 
     private static final String s_name = "liststoragepoolsresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/storage/ListStorageProvidersCmd.java b/api/src/org/apache/cloudstack/api/command/admin/storage/ListStorageProvidersCmd.java
index 3e960ee84a8..568bf7b63ab 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/storage/ListStorageProvidersCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/storage/ListStorageProvidersCmd.java
@@ -20,7 +20,8 @@
 
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -40,7 +41,7 @@
 @APICommand(name = "listStorageProviders", description = "Lists storage providers.", responseObject = StorageProviderResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListStorageProvidersCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListStorageProvidersCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListStorageProvidersCmd.class.getName());
     private static final String s_name = "liststorageprovidersresponse";
 
     @Parameter(name = ApiConstants.TYPE, type = CommandType.STRING, description = "the type of storage provider: either primary or image", required = true)
diff --git a/api/src/org/apache/cloudstack/api/command/admin/storage/ListStorageTagsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/storage/ListStorageTagsCmd.java
index 9e0aeccee5e..e1cc6e4830f 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/storage/ListStorageTagsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/storage/ListStorageTagsCmd.java
@@ -18,7 +18,8 @@
  */
 package org.apache.cloudstack.api.command.admin.storage;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
 import org.apache.cloudstack.api.BaseListCmd;
@@ -27,7 +28,7 @@
 
 @APICommand(name = "listStorageTags", description = "Lists storage tags", responseObject = StorageTagResponse.class, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListStorageTagsCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListStorageTagsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListStorageTagsCmd.class.getName());
 
     private static final String s_name = "liststoragetagsresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/storage/PreparePrimaryStorageForMaintenanceCmd.java b/api/src/org/apache/cloudstack/api/command/admin/storage/PreparePrimaryStorageForMaintenanceCmd.java
index cf5fdf66c64..31b435b592b 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/storage/PreparePrimaryStorageForMaintenanceCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/storage/PreparePrimaryStorageForMaintenanceCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.storage;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -37,7 +38,7 @@
 @APICommand(name = "enableStorageMaintenance", description = "Puts storage pool into maintenance state", responseObject = StoragePoolResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class PreparePrimaryStorageForMaintenanceCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(PreparePrimaryStorageForMaintenanceCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(PreparePrimaryStorageForMaintenanceCmd.class.getName());
     private static final String s_name = "prepareprimarystorageformaintenanceresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/storage/UpdateCloudToUseObjectStoreCmd.java b/api/src/org/apache/cloudstack/api/command/admin/storage/UpdateCloudToUseObjectStoreCmd.java
index a99c5e5d75c..6f793798efb 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/storage/UpdateCloudToUseObjectStoreCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/storage/UpdateCloudToUseObjectStoreCmd.java
@@ -21,7 +21,8 @@
 import java.util.Iterator;
 import java.util.Map;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -38,7 +39,7 @@
 @APICommand(name = "updateCloudToUseObjectStore", description = "Migrate current NFS secondary storages to use object store.", responseObject = ImageStoreResponse.class, since = "4.3.0",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateCloudToUseObjectStoreCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateCloudToUseObjectStoreCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateCloudToUseObjectStoreCmd.class.getName());
     private static final String s_name = "updatecloudtouseobjectstoreresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/storage/UpdateStoragePoolCmd.java b/api/src/org/apache/cloudstack/api/command/admin/storage/UpdateStoragePoolCmd.java
index 6bf62282a7a..45733c94763 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/storage/UpdateStoragePoolCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/storage/UpdateStoragePoolCmd.java
@@ -18,7 +18,8 @@
 
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -34,7 +35,7 @@
 @APICommand(name = "updateStoragePool", description = "Updates a storage pool.", responseObject = StoragePoolResponse.class, since = "3.0.0",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateStoragePoolCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateStoragePoolCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateStoragePoolCmd.class.getName());
 
     private static final String s_name = "updatestoragepoolresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/swift/AddSwiftCmd.java b/api/src/org/apache/cloudstack/api/command/admin/swift/AddSwiftCmd.java
index 19a84252dd7..2fed9c5470b 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/swift/AddSwiftCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/swift/AddSwiftCmd.java
@@ -19,7 +19,8 @@
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -36,7 +37,7 @@
 @APICommand(name = "addSwift", description = "Adds Swift.", responseObject = ImageStoreResponse.class, since = "3.0.0",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class AddSwiftCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(AddSwiftCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(AddSwiftCmd.class.getName());
     private static final String s_name = "addswiftresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/swift/ListSwiftsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/swift/ListSwiftsCmd.java
index f80cfab4bdd..8348f419511 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/swift/ListSwiftsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/swift/ListSwiftsCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.swift;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -31,7 +32,7 @@
 @APICommand(name = "listSwifts", description = "List Swift.", responseObject = ImageStoreResponse.class, since = "3.0.0",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListSwiftsCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListSwiftsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListSwiftsCmd.class.getName());
     private static final String s_name = "listswiftsresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/systemvm/DestroySystemVmCmd.java b/api/src/org/apache/cloudstack/api/command/admin/systemvm/DestroySystemVmCmd.java
index 47dfe8b7241..6af604ba6e9 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/systemvm/DestroySystemVmCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/systemvm/DestroySystemVmCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.systemvm;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -37,7 +38,7 @@
 @APICommand(name = "destroySystemVm", responseObject = SystemVmResponse.class, description = "Destroyes a system virtual machine.", entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DestroySystemVmCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DestroySystemVmCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DestroySystemVmCmd.class.getName());
 
     private static final String s_name = "destroysystemvmresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/systemvm/ListSystemVMsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/systemvm/ListSystemVMsCmd.java
index 2b2faf50113..7807c4bfbac 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/systemvm/ListSystemVMsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/systemvm/ListSystemVMsCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -39,7 +40,7 @@
 @APICommand(name = "listSystemVms", description = "List system virtual machines.", responseObject = SystemVmResponse.class, entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListSystemVMsCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListSystemVMsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListSystemVMsCmd.class.getName());
 
     private static final String s_name = "listsystemvmsresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/systemvm/MigrateSystemVMCmd.java b/api/src/org/apache/cloudstack/api/command/admin/systemvm/MigrateSystemVMCmd.java
index 97acfe0c46a..1dd656d45cc 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/systemvm/MigrateSystemVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/systemvm/MigrateSystemVMCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.systemvm;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -43,7 +44,7 @@
 @APICommand(name = "migrateSystemVm", description = "Attempts Migration of a system virtual machine to the host specified.", responseObject = SystemVmResponse.class, entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class MigrateSystemVMCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(MigrateSystemVMCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(MigrateSystemVMCmd.class.getName());
 
     private static final String s_name = "migratesystemvmresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/systemvm/RebootSystemVmCmd.java b/api/src/org/apache/cloudstack/api/command/admin/systemvm/RebootSystemVmCmd.java
index f439ddf4def..2f94f620f6e 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/systemvm/RebootSystemVmCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/systemvm/RebootSystemVmCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.systemvm;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -37,7 +38,7 @@
 @APICommand(name = "rebootSystemVm", description = "Reboots a system VM.", responseObject = SystemVmResponse.class, entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class RebootSystemVmCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(RebootSystemVmCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(RebootSystemVmCmd.class.getName());
 
     private static final String s_name = "rebootsystemvmresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/systemvm/ScaleSystemVMCmd.java b/api/src/org/apache/cloudstack/api/command/admin/systemvm/ScaleSystemVMCmd.java
index d53da3603b6..4e63365b0f9 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/systemvm/ScaleSystemVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/systemvm/ScaleSystemVMCmd.java
@@ -18,7 +18,8 @@
 
 import java.util.Map;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -47,7 +48,7 @@
         + "The system vm must be in a \"Stopped\" state for " + "this command to take effect.", entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ScaleSystemVMCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(UpgradeVMCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpgradeVMCmd.class.getName());
     private static final String s_name = "changeserviceforsystemvmresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/systemvm/StartSystemVMCmd.java b/api/src/org/apache/cloudstack/api/command/admin/systemvm/StartSystemVMCmd.java
index c456592d105..6ea2b5581d9 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/systemvm/StartSystemVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/systemvm/StartSystemVMCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.systemvm;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -37,7 +38,7 @@
 @APICommand(name = "startSystemVm", responseObject = SystemVmResponse.class, description = "Starts a system virtual machine.", entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class StartSystemVMCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(StartSystemVMCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(StartSystemVMCmd.class.getName());
 
     private static final String s_name = "startsystemvmresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/systemvm/StopSystemVmCmd.java b/api/src/org/apache/cloudstack/api/command/admin/systemvm/StopSystemVmCmd.java
index d60460ced1e..6f397f4a7d4 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/systemvm/StopSystemVmCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/systemvm/StopSystemVmCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.systemvm;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -39,7 +40,7 @@
 @APICommand(name = "stopSystemVm", description = "Stops a system VM.", responseObject = SystemVmResponse.class, entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class StopSystemVmCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(StopSystemVmCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(StopSystemVmCmd.class.getName());
 
     private static final String s_name = "stopsystemvmresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/systemvm/UpgradeSystemVMCmd.java b/api/src/org/apache/cloudstack/api/command/admin/systemvm/UpgradeSystemVMCmd.java
index 4e0547ad1a0..f1ff55a73be 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/systemvm/UpgradeSystemVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/systemvm/UpgradeSystemVMCmd.java
@@ -18,7 +18,8 @@
 
 import java.util.Map;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -42,7 +43,7 @@
         + "The system vm must be in a \"Stopped\" state for " + "this command to take effect.", entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpgradeSystemVMCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(UpgradeVMCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpgradeVMCmd.class.getName());
     private static final String s_name = "changeserviceforsystemvmresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/template/CopyTemplateCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/template/CopyTemplateCmdByAdmin.java
index e0c798c7849..3b2c36c84af 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/template/CopyTemplateCmdByAdmin.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/template/CopyTemplateCmdByAdmin.java
@@ -18,7 +18,8 @@
 
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiErrorCode;
@@ -35,7 +36,7 @@
 @APICommand(name = "copyTemplate", description = "Copies a template from one zone to another.", responseObject = TemplateResponse.class, responseView = ResponseView.Full,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CopyTemplateCmdByAdmin extends CopyTemplateCmd {
-    public static final Logger s_logger = Logger.getLogger(CopyTemplateCmdByAdmin.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CopyTemplateCmdByAdmin.class.getName());
 
     @Override
     public void execute() throws ResourceAllocationException{
diff --git a/api/src/org/apache/cloudstack/api/command/admin/template/CreateTemplateCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/template/CreateTemplateCmdByAdmin.java
index 51d9c8db084..1104427fc1d 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/template/CreateTemplateCmdByAdmin.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/template/CreateTemplateCmdByAdmin.java
@@ -18,7 +18,8 @@
 
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiErrorCode;
@@ -34,7 +35,7 @@
         + "A template created from this command is automatically designated as a private template visible to the account that created it.", responseView = ResponseView.Full,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreateTemplateCmdByAdmin extends CreateTemplateCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateTemplateCmdByAdmin.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateTemplateCmdByAdmin.class.getName());
 
     @Override
     public void execute() {
diff --git a/api/src/org/apache/cloudstack/api/command/admin/template/PrepareTemplateCmd.java b/api/src/org/apache/cloudstack/api/command/admin/template/PrepareTemplateCmd.java
index 0537c01fd3c..bd8591fde6a 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/template/PrepareTemplateCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/template/PrepareTemplateCmd.java
@@ -18,7 +18,8 @@
 
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -38,7 +39,7 @@
 @APICommand(name = "prepareTemplate", responseObject = TemplateResponse.class, description = "load template into primary storage", entityType = {VirtualMachineTemplate.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class PrepareTemplateCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(PrepareTemplateCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(PrepareTemplateCmd.class.getName());
 
     private static final String s_name = "preparetemplateresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/template/RegisterTemplateCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/template/RegisterTemplateCmdByAdmin.java
index 7281197305b..b4f196b4fd5 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/template/RegisterTemplateCmdByAdmin.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/template/RegisterTemplateCmdByAdmin.java
@@ -19,7 +19,8 @@
 import java.net.URISyntaxException;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiErrorCode;
@@ -35,7 +36,7 @@
 @APICommand(name = "registerTemplate", description = "Registers an existing template into the CloudStack cloud.", responseObject = TemplateResponse.class, responseView = ResponseView.Full,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class RegisterTemplateCmdByAdmin extends RegisterTemplateCmd {
-    public static final Logger s_logger = Logger.getLogger(RegisterTemplateCmdByAdmin.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(RegisterTemplateCmdByAdmin.class.getName());
 
     @Override
     public void execute() throws ResourceAllocationException{
diff --git a/api/src/org/apache/cloudstack/api/command/admin/template/UpdateTemplateCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/template/UpdateTemplateCmdByAdmin.java
index 94f8ff20386..48736e85350 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/template/UpdateTemplateCmdByAdmin.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/template/UpdateTemplateCmdByAdmin.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.template;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiErrorCode;
@@ -30,7 +31,7 @@
 @APICommand(name = "updateTemplate", description = "Updates attributes of a template.", responseObject = TemplateResponse.class, responseView = ResponseView.Full,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateTemplateCmdByAdmin extends UpdateTemplateCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateTemplateCmdByAdmin.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateTemplateCmdByAdmin.class.getName());
 
     @Override
     public void execute(){
diff --git a/api/src/org/apache/cloudstack/api/command/admin/usage/AddTrafficMonitorCmd.java b/api/src/org/apache/cloudstack/api/command/admin/usage/AddTrafficMonitorCmd.java
index e0d755518f9..526891ad791 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/usage/AddTrafficMonitorCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/usage/AddTrafficMonitorCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.usage;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -35,7 +36,7 @@
 @APICommand(name = "addTrafficMonitor", description = "Adds Traffic Monitor Host for Direct Network Usage", responseObject = TrafficMonitorResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class AddTrafficMonitorCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(AddTrafficMonitorCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(AddTrafficMonitorCmd.class.getName());
     private static final String s_name = "addtrafficmonitorresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/usage/AddTrafficTypeCmd.java b/api/src/org/apache/cloudstack/api/command/admin/usage/AddTrafficTypeCmd.java
index 9e4254c49aa..6cd377f6efc 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/usage/AddTrafficTypeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/usage/AddTrafficTypeCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.usage;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -37,7 +38,7 @@
 @APICommand(name = "addTrafficType", description = "Adds traffic type to a physical network", responseObject = TrafficTypeResponse.class, since = "3.0.0",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class AddTrafficTypeCmd extends BaseAsyncCreateCmd {
-    public static final Logger s_logger = Logger.getLogger(AddTrafficTypeCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(AddTrafficTypeCmd.class.getName());
 
     private static final String s_name = "addtraffictyperesponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/usage/DeleteTrafficMonitorCmd.java b/api/src/org/apache/cloudstack/api/command/admin/usage/DeleteTrafficMonitorCmd.java
index 4c2bac23a17..0a437db4372 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/usage/DeleteTrafficMonitorCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/usage/DeleteTrafficMonitorCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.usage;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -33,7 +34,7 @@
 @APICommand(name = "deleteTrafficMonitor", description = "Deletes an traffic monitor host.", responseObject = SuccessResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteTrafficMonitorCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteTrafficMonitorCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteTrafficMonitorCmd.class.getName());
     private static final String s_name = "deletetrafficmonitorresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/usage/DeleteTrafficTypeCmd.java b/api/src/org/apache/cloudstack/api/command/admin/usage/DeleteTrafficTypeCmd.java
index 46383cca725..bc0bd1aa2b5 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/usage/DeleteTrafficTypeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/usage/DeleteTrafficTypeCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.usage;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -34,7 +35,7 @@
 @APICommand(name = "deleteTrafficType", description = "Deletes traffic type of a physical network", responseObject = SuccessResponse.class, since = "3.0.0",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteTrafficTypeCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteTrafficTypeCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteTrafficTypeCmd.class.getName());
 
     private static final String s_name = "deletetraffictyperesponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/usage/GenerateUsageRecordsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/usage/GenerateUsageRecordsCmd.java
index 184f88aed24..9397fc09d3b 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/usage/GenerateUsageRecordsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/usage/GenerateUsageRecordsCmd.java
@@ -18,7 +18,8 @@
 
 import java.util.Date;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -37,7 +38,7 @@
             requestHasSensitiveInfo = false,
             responseHasSensitiveInfo = false)
 public class GenerateUsageRecordsCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(GenerateUsageRecordsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(GenerateUsageRecordsCmd.class.getName());
 
     private static final String s_name = "generateusagerecordsresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/usage/GetUsageRecordsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/usage/GetUsageRecordsCmd.java
index 4cceb3b5f9f..8b5eb85492c 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/usage/GetUsageRecordsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/usage/GetUsageRecordsCmd.java
@@ -20,7 +20,8 @@
 import java.util.Date;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -38,7 +39,7 @@
 @APICommand(name = "listUsageRecords", description = "Lists usage records for accounts", responseObject = UsageRecordResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class GetUsageRecordsCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(GetUsageRecordsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(GetUsageRecordsCmd.class.getName());
 
     private static final String s_name = "listusagerecordsresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/usage/ListTrafficMonitorsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/usage/ListTrafficMonitorsCmd.java
index 4c398633f14..342ab879133 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/usage/ListTrafficMonitorsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/usage/ListTrafficMonitorsCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -35,7 +36,7 @@
 @APICommand(name = "listTrafficMonitors", description = "List traffic monitor Hosts.", responseObject = TrafficMonitorResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListTrafficMonitorsCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListServiceOfferingsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListServiceOfferingsCmd.class.getName());
     private static final String s_name = "listtrafficmonitorsresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/usage/ListTrafficTypeImplementorsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/usage/ListTrafficTypeImplementorsCmd.java
index bd634bbe5c2..65853568536 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/usage/ListTrafficTypeImplementorsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/usage/ListTrafficTypeImplementorsCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -44,7 +45,7 @@
             requestHasSensitiveInfo = false,
             responseHasSensitiveInfo = false)
 public class ListTrafficTypeImplementorsCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListTrafficTypeImplementorsCmd.class);
+    public static final Logger s_logger = LogManager.getLogger(ListTrafficTypeImplementorsCmd.class);
     private static final String s_name = "listtraffictypeimplementorsresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/usage/ListTrafficTypesCmd.java b/api/src/org/apache/cloudstack/api/command/admin/usage/ListTrafficTypesCmd.java
index a5a5a5d8d3d..a5cd5fe7648 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/usage/ListTrafficTypesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/usage/ListTrafficTypesCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -37,7 +38,7 @@
 @APICommand(name = "listTrafficTypes", description = "Lists traffic types of a given physical network.", responseObject = ProviderResponse.class, since = "3.0.0",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListTrafficTypesCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListTrafficTypesCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListTrafficTypesCmd.class.getName());
     private static final String s_name = "listtraffictypesresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/usage/ListUsageTypesCmd.java b/api/src/org/apache/cloudstack/api/command/admin/usage/ListUsageTypesCmd.java
index 2c5a7866cbb..2a6ad09a072 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/usage/ListUsageTypesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/usage/ListUsageTypesCmd.java
@@ -18,7 +18,8 @@
 
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.BaseCmd;
@@ -30,7 +31,7 @@
 @APICommand(name = "listUsageTypes", description = "List Usage Types", responseObject = UsageTypeResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListUsageTypesCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(ListUsageTypesCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListUsageTypesCmd.class.getName());
     private static final String s_name = "listusagetypesresponse";
 
     @Override
diff --git a/api/src/org/apache/cloudstack/api/command/admin/usage/RemoveRawUsageRecordsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/usage/RemoveRawUsageRecordsCmd.java
index da7871cbb9d..afa477153be 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/usage/RemoveRawUsageRecordsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/usage/RemoveRawUsageRecordsCmd.java
@@ -29,11 +29,12 @@
 import org.apache.cloudstack.api.Parameter;
 import org.apache.cloudstack.api.ServerApiException;
 import org.apache.cloudstack.api.response.SuccessResponse;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 @APICommand(name = "removeRawUsageRecords", description = "Safely removes raw records from cloud_usage table", responseObject = SuccessResponse.class, since = "4.6.0", requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class RemoveRawUsageRecordsCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(RemoveRawUsageRecordsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(RemoveRawUsageRecordsCmd.class.getName());
 
     private static final String s_name = "removerawusagerecordsresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/usage/UpdateTrafficTypeCmd.java b/api/src/org/apache/cloudstack/api/command/admin/usage/UpdateTrafficTypeCmd.java
index 6d0824cca79..2bb30366603 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/usage/UpdateTrafficTypeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/usage/UpdateTrafficTypeCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.usage;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -34,7 +35,7 @@
 @APICommand(name = "updateTrafficType", description = "Updates traffic type of a physical network", responseObject = TrafficTypeResponse.class, since = "3.0.0",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateTrafficTypeCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateTrafficTypeCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateTrafficTypeCmd.class.getName());
 
     private static final String s_name = "updatetraffictyperesponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/user/CreateUserCmd.java b/api/src/org/apache/cloudstack/api/command/admin/user/CreateUserCmd.java
index 71d6a661af3..5dfbd2fc050 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/user/CreateUserCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/user/CreateUserCmd.java
@@ -26,7 +26,8 @@
 import org.apache.cloudstack.api.response.UserResponse;
 import org.apache.cloudstack.context.CallContext;
 import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.user.Account;
 import com.cloud.user.User;
@@ -34,7 +35,7 @@
 @APICommand(name = "createUser", description = "Creates a user for an account that already exists", responseObject = UserResponse.class,
         requestHasSensitiveInfo = true, responseHasSensitiveInfo = true)
 public class CreateUserCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateUserCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateUserCmd.class.getName());
 
     private static final String s_name = "createuserresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/user/DeleteUserCmd.java b/api/src/org/apache/cloudstack/api/command/admin/user/DeleteUserCmd.java
index 08ba521ed62..6608a2aaa78 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/user/DeleteUserCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/user/DeleteUserCmd.java
@@ -18,7 +18,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -37,7 +38,7 @@
 @APICommand(name = "deleteUser", description = "Deletes a user for an account", responseObject = SuccessResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteUserCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteUserCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteUserCmd.class.getName());
 
     private static final String s_name = "deleteuserresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/user/DisableUserCmd.java b/api/src/org/apache/cloudstack/api/command/admin/user/DisableUserCmd.java
index c6e09ef0f9e..e878b8ab1b8 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/user/DisableUserCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/user/DisableUserCmd.java
@@ -18,7 +18,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -39,7 +40,7 @@
 @APICommand(name = "disableUser", description = "Disables a user account", responseObject = UserResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class DisableUserCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DisableUserCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DisableUserCmd.class.getName());
     private static final String s_name = "disableuserresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/user/EnableUserCmd.java b/api/src/org/apache/cloudstack/api/command/admin/user/EnableUserCmd.java
index d69eccf9342..d365850b9ef 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/user/EnableUserCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/user/EnableUserCmd.java
@@ -18,7 +18,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -37,7 +38,7 @@
 @APICommand(name = "enableUser", description = "Enables a user account", responseObject = UserResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class EnableUserCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(EnableUserCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(EnableUserCmd.class.getName());
     private static final String s_name = "enableuserresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/user/GetUserCmd.java b/api/src/org/apache/cloudstack/api/command/admin/user/GetUserCmd.java
index d58f6959632..a0d2aba5fa3 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/user/GetUserCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/user/GetUserCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.user;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -30,7 +31,7 @@
 @APICommand(name = "getUser", description = "Find user account by API key", responseObject = UserResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class GetUserCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(GetUserCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(GetUserCmd.class.getName());
 
     private static final String s_name = "getuserresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/user/GetUserKeysCmd.java b/api/src/org/apache/cloudstack/api/command/admin/user/GetUserKeysCmd.java
index f93c6e11728..a384cc83d8e 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/user/GetUserKeysCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/user/GetUserKeysCmd.java
@@ -17,6 +17,7 @@
 
 package org.apache.cloudstack.api.command.admin.user;
 
+import java.util.Map;
 
 import com.cloud.user.Account;
 import com.cloud.user.User;
@@ -27,9 +28,8 @@
 import org.apache.cloudstack.api.Parameter;
 import org.apache.cloudstack.api.response.RegisterResponse;
 import org.apache.cloudstack.api.response.UserResponse;
-
-import java.util.Map;
-import java.util.logging.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 @APICommand(name = GetUserKeysCmd.APINAME,
             description = "This command allows the user to query the seceret and API keys for the account",
@@ -44,7 +44,7 @@
     @Parameter(name= ApiConstants.ID, type = CommandType.UUID, entityType = UserResponse.class, required = true, description = "ID of the user whose keys are required")
     private Long id;
 
-    public static final Logger s_logger = Logger.getLogger(RegisterCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(RegisterCmd.class.getName());
     public static final String APINAME = "getUserKeys";
 
     public Long getID(){
diff --git a/api/src/org/apache/cloudstack/api/command/admin/user/ListUsersCmd.java b/api/src/org/apache/cloudstack/api/command/admin/user/ListUsersCmd.java
index c0c2b24814a..3f305ce2d1c 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/user/ListUsersCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/user/ListUsersCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.user;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -28,7 +29,7 @@
 @APICommand(name = "listUsers", description = "Lists user accounts", responseObject = UserResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class ListUsersCmd extends BaseListAccountResourcesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListUsersCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListUsersCmd.class.getName());
 
     private static final String s_name = "listusersresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/user/LockUserCmd.java b/api/src/org/apache/cloudstack/api/command/admin/user/LockUserCmd.java
index 69623d013d4..4bcf42ac392 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/user/LockUserCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/user/LockUserCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.user;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -33,7 +34,7 @@
 @APICommand(name = "lockUser", description = "Locks a user account", responseObject = UserResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class LockUserCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(LockUserCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(LockUserCmd.class.getName());
 
     private static final String s_name = "lockuserresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/user/RegisterCmd.java b/api/src/org/apache/cloudstack/api/command/admin/user/RegisterCmd.java
index 2732bb90589..9222c181e7a 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/user/RegisterCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/user/RegisterCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.user;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -33,7 +34,7 @@
             description = "This command allows a user to register for the developer API, returning a secret key and an API key. This request is made through the integration API port, so it is a privileged command and must be made on behalf of a user. It is up to the implementer just how the username and password are entered, and then how that translates to an integration API request. Both secret key and API key should be returned to the user",
             requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class RegisterCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(RegisterCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(RegisterCmd.class.getName());
 
     private static final String s_name = "registeruserkeysresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/user/UpdateUserCmd.java b/api/src/org/apache/cloudstack/api/command/admin/user/UpdateUserCmd.java
index e6ac36719e3..05bf9e4e75e 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/user/UpdateUserCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/user/UpdateUserCmd.java
@@ -27,7 +27,8 @@
 import org.apache.cloudstack.api.response.UserResponse;
 import org.apache.cloudstack.context.CallContext;
 import org.apache.cloudstack.region.RegionService;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.user.Account;
 import com.cloud.user.User;
@@ -36,7 +37,7 @@
 @APICommand(name = "updateUser", description = "Updates a user account", responseObject = UserResponse.class,
         requestHasSensitiveInfo = true, responseHasSensitiveInfo = true)
 public class UpdateUserCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateUserCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateUserCmd.class.getName());
 
     private static final String s_name = "updateuserresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vlan/CreateVlanIpRangeCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vlan/CreateVlanIpRangeCmd.java
index a2da7dbc8da..3f97e452e37 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vlan/CreateVlanIpRangeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vlan/CreateVlanIpRangeCmd.java
@@ -17,7 +17,8 @@
 package org.apache.cloudstack.api.command.admin.vlan;
 
 import com.cloud.utils.net.NetUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -43,7 +44,7 @@
 @APICommand(name = "createVlanIpRange", description = "Creates a VLAN IP range.", responseObject = VlanIpRangeResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreateVlanIpRangeCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateVlanIpRangeCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateVlanIpRangeCmd.class.getName());
 
     private static final String s_name = "createvlaniprangeresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vlan/DedicatePublicIpRangeCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vlan/DedicatePublicIpRangeCmd.java
index 58a8458312d..390744927f1 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vlan/DedicatePublicIpRangeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vlan/DedicatePublicIpRangeCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.vlan;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -36,7 +37,7 @@
 @APICommand(name = "dedicatePublicIpRange", description = "Dedicates a Public IP range to an account", responseObject = VlanIpRangeResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DedicatePublicIpRangeCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(DedicatePublicIpRangeCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DedicatePublicIpRangeCmd.class.getName());
 
     private static final String s_name = "dedicatepubliciprangeresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vlan/DeleteVlanIpRangeCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vlan/DeleteVlanIpRangeCmd.java
index af32fc4ebd7..0060b60d63c 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vlan/DeleteVlanIpRangeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vlan/DeleteVlanIpRangeCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.vlan;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -32,7 +33,7 @@
 @APICommand(name = "deleteVlanIpRange", description = "Creates a VLAN IP range.", responseObject = SuccessResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteVlanIpRangeCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteVlanIpRangeCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteVlanIpRangeCmd.class.getName());
 
     private static final String s_name = "deletevlaniprangeresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vlan/ListVlanIpRangesCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vlan/ListVlanIpRangesCmd.java
index d4f2d5ad611..1c5a0b6421a 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vlan/ListVlanIpRangesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vlan/ListVlanIpRangesCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -40,7 +41,7 @@
 @APICommand(name = "listVlanIpRanges", description = "Lists all VLAN IP ranges.", responseObject = VlanIpRangeResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListVlanIpRangesCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListVlanIpRangesCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListVlanIpRangesCmd.class.getName());
 
     private static final String s_name = "listvlaniprangesresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vlan/ReleasePublicIpRangeCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vlan/ReleasePublicIpRangeCmd.java
index 15cfbc64e30..922e852f266 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vlan/ReleasePublicIpRangeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vlan/ReleasePublicIpRangeCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.vlan;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -32,7 +33,7 @@
 @APICommand(name = "releasePublicIpRange", description = "Releases a Public IP range back to the system pool", responseObject = SuccessResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ReleasePublicIpRangeCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(ReleasePublicIpRangeCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ReleasePublicIpRangeCmd.class.getName());
 
     private static final String s_name = "releasepubliciprangeresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vm/AddNicToVMCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/vm/AddNicToVMCmdByAdmin.java
index 945f8499fe4..9c8ba6322ab 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vm/AddNicToVMCmdByAdmin.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vm/AddNicToVMCmdByAdmin.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.EnumSet;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants.VMDetails;
@@ -37,7 +38,7 @@
 @APICommand(name = "addNicToVirtualMachine", description = "Adds VM to specified network by creating a NIC", responseObject = UserVmResponse.class, responseView = ResponseView.Full, entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class AddNicToVMCmdByAdmin extends AddNicToVMCmd {
-    public static final Logger s_logger = Logger.getLogger(AddNicToVMCmdByAdmin.class);
+    public static final Logger s_logger = LogManager.getLogger(AddNicToVMCmdByAdmin.class);
 
     @Override
     public void execute(){
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vm/AssignVMCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vm/AssignVMCmd.java
index da5f68860bc..af2f1dea1b0 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vm/AssignVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vm/AssignVMCmd.java
@@ -18,7 +18,8 @@
 
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -45,7 +46,7 @@
             requestHasSensitiveInfo = false,
             responseHasSensitiveInfo = true)
 public class AssignVMCmd extends BaseCmd  {
-    public static final Logger s_logger = Logger.getLogger(AssignVMCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(AssignVMCmd.class.getName());
 
     private static final String s_name = "assignvirtualmachineresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vm/DeployVMCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/vm/DeployVMCmdByAdmin.java
index 03bb4c623d0..25690b8a070 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vm/DeployVMCmdByAdmin.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vm/DeployVMCmdByAdmin.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.vm;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiErrorCode;
@@ -37,7 +38,7 @@
 @APICommand(name = "deployVirtualMachine", description = "Creates and automatically starts a virtual machine based on a service offering, disk offering, and template.", responseObject = UserVmResponse.class, responseView = ResponseView.Full, entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class DeployVMCmdByAdmin extends DeployVMCmd {
-    public static final Logger s_logger = Logger.getLogger(DeployVMCmdByAdmin.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeployVMCmdByAdmin.class.getName());
 
 
     @Override
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vm/DestroyVMCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/vm/DestroyVMCmdByAdmin.java
index 73a80d557f3..650afe9cd76 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vm/DestroyVMCmdByAdmin.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vm/DestroyVMCmdByAdmin.java
@@ -18,7 +18,8 @@
 
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiErrorCode;
@@ -37,7 +38,7 @@
         requestHasSensitiveInfo = false,
         responseHasSensitiveInfo = true)
 public class DestroyVMCmdByAdmin extends DestroyVMCmd {
-    public static final Logger s_logger = Logger.getLogger(DestroyVMCmdByAdmin.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DestroyVMCmdByAdmin.class.getName());
 
 
     @Override
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vm/ExpungeVMCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vm/ExpungeVMCmd.java
index 155fcfff4d3..290e7e4b849 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vm/ExpungeVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vm/ExpungeVMCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.vm;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -43,7 +44,7 @@
 @APICommand(name = "expungeVirtualMachine", description = "Expunge a virtual machine. Once expunged, it cannot be recoverd.", responseObject = SuccessResponse.class, entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ExpungeVMCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(ExpungeVMCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ExpungeVMCmd.class.getName());
 
     private static final String s_name = "expungevirtualmachineresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vm/GetVMUserDataCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vm/GetVMUserDataCmd.java
index bf39f99519f..7dbd70c2451 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vm/GetVMUserDataCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vm/GetVMUserDataCmd.java
@@ -24,7 +24,8 @@
 import org.apache.cloudstack.api.Parameter;
 import org.apache.cloudstack.api.response.UserVmResponse;
 import org.apache.cloudstack.api.response.VMUserDataResponse;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.user.Account;
 import com.cloud.uservm.UserVm;
@@ -32,7 +33,7 @@
 @APICommand(name = "getVirtualMachineUserData", description = "Returns user data associated with the VM", responseObject = VMUserDataResponse.class, since = "4.4",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class GetVMUserDataCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(GetVMUserDataCmd.class);
+    public static final Logger s_logger = LogManager.getLogger(GetVMUserDataCmd.class);
     private static final String s_name = "getvirtualmachineuserdataresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vm/ListVMsCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/vm/ListVMsCmdByAdmin.java
index f41e196c87c..b125eb56296 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vm/ListVMsCmdByAdmin.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vm/ListVMsCmdByAdmin.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.vm;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -33,7 +34,7 @@
 @APICommand(name = "listVirtualMachines", description = "List the virtual machines owned by the account.", responseObject = UserVmResponse.class, responseView = ResponseView.Full, entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class ListVMsCmdByAdmin extends ListVMsCmd {
-    public static final Logger s_logger = Logger.getLogger(ListVMsCmdByAdmin.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListVMsCmdByAdmin.class.getName());
 
     /////////////////////////////////////////////////////
     //////////////// API parameters /////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vm/MigrateVMCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vm/MigrateVMCmd.java
index d6d62720123..d44039a7d7e 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vm/MigrateVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vm/MigrateVMCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.vm;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -48,7 +49,7 @@
             requestHasSensitiveInfo = false,
             responseHasSensitiveInfo = true)
 public class MigrateVMCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(MigrateVMCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(MigrateVMCmd.class.getName());
 
     private static final String s_name = "migratevirtualmachineresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vm/MigrateVirtualMachineWithVolumeCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vm/MigrateVirtualMachineWithVolumeCmd.java
index 32000c63644..f14eac3feb2 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vm/MigrateVirtualMachineWithVolumeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vm/MigrateVirtualMachineWithVolumeCmd.java
@@ -21,7 +21,8 @@
 import java.util.Iterator;
 import java.util.Map;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -50,7 +51,7 @@
             requestHasSensitiveInfo = false,
             responseHasSensitiveInfo = true)
 public class MigrateVirtualMachineWithVolumeCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(MigrateVMCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(MigrateVMCmd.class.getName());
 
     private static final String s_name = "migratevirtualmachinewithvolumeresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vm/RebootVMCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/vm/RebootVMCmdByAdmin.java
index e0c36682899..482c9da98c9 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vm/RebootVMCmdByAdmin.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vm/RebootVMCmdByAdmin.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.vm;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiErrorCode;
@@ -34,7 +35,7 @@
 @APICommand(name = "rebootVirtualMachine", description = "Reboots a virtual machine.", responseObject = UserVmResponse.class, responseView = ResponseView.Full, entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class RebootVMCmdByAdmin extends RebootVMCmd {
-    public static final Logger s_logger = Logger.getLogger(RebootVMCmdByAdmin.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(RebootVMCmdByAdmin.class.getName());
 
     @Override
     public void execute() throws ResourceUnavailableException, InsufficientCapacityException{
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vm/RecoverVMCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vm/RecoverVMCmd.java
index 4ad09171540..143b57112a9 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vm/RecoverVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vm/RecoverVMCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.vm;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -35,7 +36,7 @@
 @APICommand(name = "recoverVirtualMachine", description = "Recovers a virtual machine.", responseObject = UserVmResponse.class, entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class RecoverVMCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(RecoverVMCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(RecoverVMCmd.class.getName());
 
     private static final String s_name = "recovervirtualmachineresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vm/RemoveNicFromVMCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/vm/RemoveNicFromVMCmdByAdmin.java
index ff1c54cef6c..2d94f0f0c0f 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vm/RemoveNicFromVMCmdByAdmin.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vm/RemoveNicFromVMCmdByAdmin.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.EnumSet;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants.VMDetails;
@@ -36,7 +37,7 @@
 @APICommand(name = "removeNicFromVirtualMachine", description = "Removes VM from specified network by deleting a NIC", responseObject = UserVmResponse.class, responseView = ResponseView.Full, entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class RemoveNicFromVMCmdByAdmin extends RemoveNicFromVMCmd {
-    public static final Logger s_logger = Logger.getLogger(RemoveNicFromVMCmdByAdmin.class);
+    public static final Logger s_logger = LogManager.getLogger(RemoveNicFromVMCmdByAdmin.class);
 
     @Override
     public void execute(){
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vm/ResetVMPasswordCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/vm/ResetVMPasswordCmdByAdmin.java
index a53e61ad91a..362e9884c5c 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vm/ResetVMPasswordCmdByAdmin.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vm/ResetVMPasswordCmdByAdmin.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.vm;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiErrorCode;
@@ -36,7 +37,7 @@
         "support this feature for this command to take effect. [async]", responseView = ResponseView.Full, entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class ResetVMPasswordCmdByAdmin extends ResetVMPasswordCmd {
-    public static final Logger s_logger = Logger.getLogger(ResetVMPasswordCmdByAdmin.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ResetVMPasswordCmdByAdmin.class.getName());
 
 
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vm/ResetVMSSHKeyCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/vm/ResetVMSSHKeyCmdByAdmin.java
index 35c47ed4c62..0e8f3abbacc 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vm/ResetVMSSHKeyCmdByAdmin.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vm/ResetVMSSHKeyCmdByAdmin.java
@@ -17,7 +17,8 @@
 
 package org.apache.cloudstack.api.command.admin.vm;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiErrorCode;
@@ -37,7 +38,7 @@
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class ResetVMSSHKeyCmdByAdmin extends ResetVMSSHKeyCmd {
 
-    public static final Logger s_logger = Logger.getLogger(ResetVMSSHKeyCmdByAdmin.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ResetVMSSHKeyCmdByAdmin.class.getName());
 
 
     @Override
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vm/RestoreVMCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/vm/RestoreVMCmdByAdmin.java
index 9a741b6ce5e..ce3bb00af79 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vm/RestoreVMCmdByAdmin.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vm/RestoreVMCmdByAdmin.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.vm;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiErrorCode;
@@ -37,7 +38,7 @@
         requestHasSensitiveInfo = false,
         responseHasSensitiveInfo = true)
 public class RestoreVMCmdByAdmin extends RestoreVMCmd {
-    public static final Logger s_logger = Logger.getLogger(RestoreVMCmdByAdmin.class);
+    public static final Logger s_logger = LogManager.getLogger(RestoreVMCmdByAdmin.class);
 
     @Override
     public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException,
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vm/ScaleVMCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/vm/ScaleVMCmdByAdmin.java
index f434fdf8ae5..48fea70e3f6 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vm/ScaleVMCmdByAdmin.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vm/ScaleVMCmdByAdmin.java
@@ -18,7 +18,8 @@
 
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiErrorCode;
@@ -39,7 +40,7 @@
 @APICommand(name = "scaleVirtualMachine", description = "Scales the virtual machine to a new service offering.", responseObject = SuccessResponse.class, responseView = ResponseView.Full, entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ScaleVMCmdByAdmin extends ScaleVMCmd {
-    public static final Logger s_logger = Logger.getLogger(ScaleVMCmdByAdmin.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ScaleVMCmdByAdmin.class.getName());
 
     @Override
     public void execute(){
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vm/StartVMCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/vm/StartVMCmdByAdmin.java
index f9688354187..1fa53483d04 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vm/StartVMCmdByAdmin.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vm/StartVMCmdByAdmin.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.vm;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiErrorCode;
@@ -39,7 +40,7 @@
 @APICommand(name = "startVirtualMachine", responseObject = UserVmResponse.class, description = "Starts a virtual machine.", responseView = ResponseView.Full, entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class StartVMCmdByAdmin extends StartVMCmd {
-    public static final Logger s_logger = Logger.getLogger(StartVMCmdByAdmin.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(StartVMCmdByAdmin.class.getName());
 
 
     @Override
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vm/StopVMCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/vm/StopVMCmdByAdmin.java
index 4cd1418603e..575d06e6408 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vm/StopVMCmdByAdmin.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vm/StopVMCmdByAdmin.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.vm;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiErrorCode;
@@ -33,7 +34,7 @@
 @APICommand(name = "stopVirtualMachine", responseObject = UserVmResponse.class, description = "Stops a virtual machine.", responseView = ResponseView.Full, entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class StopVMCmdByAdmin extends StopVMCmd {
-    public static final Logger s_logger = Logger.getLogger(StopVMCmdByAdmin.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(StopVMCmdByAdmin.class.getName());
 
 
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vm/UpdateDefaultNicForVMCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/vm/UpdateDefaultNicForVMCmdByAdmin.java
index 9a06309ee5d..d24940aa352 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vm/UpdateDefaultNicForVMCmdByAdmin.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vm/UpdateDefaultNicForVMCmdByAdmin.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.EnumSet;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants.VMDetails;
@@ -36,7 +37,7 @@
 @APICommand(name = "updateDefaultNicForVirtualMachine", description = "Changes the default NIC on a VM", responseObject = UserVmResponse.class, responseView = ResponseView.Full, entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class UpdateDefaultNicForVMCmdByAdmin extends UpdateDefaultNicForVMCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateDefaultNicForVMCmdByAdmin.class);
+    public static final Logger s_logger = LogManager.getLogger(UpdateDefaultNicForVMCmdByAdmin.class);
 
 
     @Override
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vm/UpdateVMCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/vm/UpdateVMCmdByAdmin.java
index fcafef8edc9..42118151cac 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vm/UpdateVMCmdByAdmin.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vm/UpdateVMCmdByAdmin.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.vm;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiErrorCode;
@@ -37,7 +38,7 @@
         "Therefore, stop the VM manually before issuing this call.", responseObject = UserVmResponse.class, responseView = ResponseView.Full, entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class UpdateVMCmdByAdmin extends UpdateVMCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateVMCmdByAdmin.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateVMCmdByAdmin.class.getName());
 
     @Override
     public void execute() throws ResourceUnavailableException,
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vm/UpgradeVMCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/vm/UpgradeVMCmdByAdmin.java
index 6df400a7bbd..aabf48f06a9 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vm/UpgradeVMCmdByAdmin.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vm/UpgradeVMCmdByAdmin.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.vm;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiErrorCode;
@@ -37,7 +38,7 @@
         "this command to take effect.", responseView = ResponseView.Full, entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class UpgradeVMCmdByAdmin extends UpgradeVMCmd {
-    public static final Logger s_logger = Logger.getLogger(UpgradeVMCmdByAdmin.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpgradeVMCmdByAdmin.class.getName());
 
 
     @Override
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vmsnapshot/RevertToVMSnapshotCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/vmsnapshot/RevertToVMSnapshotCmdByAdmin.java
index facce1ec615..819cbb43ad1 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vmsnapshot/RevertToVMSnapshotCmdByAdmin.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vmsnapshot/RevertToVMSnapshotCmdByAdmin.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.vmsnapshot;
 
-import java.util.logging.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiErrorCode;
@@ -35,8 +36,7 @@
 @APICommand(name = "revertToVMSnapshot", description = "Revert VM from a vmsnapshot.", responseObject = UserVmResponse.class, since = "4.2.0", responseView = ResponseView.Full,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class RevertToVMSnapshotCmdByAdmin extends RevertToVMSnapshotCmd {
-    public static final Logger s_logger = Logger
-            .getLogger(RevertToVMSnapshotCmdByAdmin.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(RevertToVMSnapshotCmdByAdmin.class.getName());
 
 
     @Override
diff --git a/api/src/org/apache/cloudstack/api/command/admin/volume/AttachVolumeCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/volume/AttachVolumeCmdByAdmin.java
index c51c1e2c48d..c5cf011938d 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/volume/AttachVolumeCmdByAdmin.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/volume/AttachVolumeCmdByAdmin.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.volume;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiErrorCode;
@@ -32,7 +33,7 @@
 @APICommand(name = "attachVolume", description = "Attaches a disk volume to a virtual machine.", responseObject = VolumeResponse.class, responseView = ResponseView.Full, entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class AttachVolumeCmdByAdmin extends AttachVolumeCmd {
-    public static final Logger s_logger = Logger.getLogger(AttachVolumeCmdByAdmin.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(AttachVolumeCmdByAdmin.class.getName());
 
     @Override
     public void execute(){
diff --git a/api/src/org/apache/cloudstack/api/command/admin/volume/CreateVolumeCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/volume/CreateVolumeCmdByAdmin.java
index 8ff3993cd57..2ec2d503772 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/volume/CreateVolumeCmdByAdmin.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/volume/CreateVolumeCmdByAdmin.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.volume;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiErrorCode;
@@ -34,7 +35,7 @@
         Volume.class, VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreateVolumeCmdByAdmin extends CreateVolumeCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateVolumeCmdByAdmin.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateVolumeCmdByAdmin.class.getName());
 
     @Override
     public void execute(){
diff --git a/api/src/org/apache/cloudstack/api/command/admin/volume/DetachVolumeCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/volume/DetachVolumeCmdByAdmin.java
index 353a06858a8..336fb6ce917 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/volume/DetachVolumeCmdByAdmin.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/volume/DetachVolumeCmdByAdmin.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.volume;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiErrorCode;
@@ -32,7 +33,7 @@
 @APICommand(name = "detachVolume", description = "Detaches a disk volume from a virtual machine.", responseObject = VolumeResponse.class, responseView = ResponseView.Full, entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DetachVolumeCmdByAdmin extends DetachVolumeCmd {
-    public static final Logger s_logger = Logger.getLogger(DetachVolumeCmdByAdmin.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DetachVolumeCmdByAdmin.class.getName());
 
 
     @Override
diff --git a/api/src/org/apache/cloudstack/api/command/admin/volume/ListVolumesCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/volume/ListVolumesCmdByAdmin.java
index 5fe5bfea485..ead046ba849 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/volume/ListVolumesCmdByAdmin.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/volume/ListVolumesCmdByAdmin.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.volume;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.api.APICommand;
@@ -34,7 +35,7 @@
 @APICommand(name = "listVolumes", description = "Lists all volumes.", responseObject = VolumeResponse.class, responseView = ResponseView.Full, entityType = {Volume.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListVolumesCmdByAdmin extends ListVolumesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListVolumesCmdByAdmin.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListVolumesCmdByAdmin.class.getName());
 
     @Parameter(name=ApiConstants.POD_ID, type=CommandType.UUID, entityType=PodResponse.class,
             description="the pod id the disk volume belongs to")
diff --git a/api/src/org/apache/cloudstack/api/command/admin/volume/UploadVolumeCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/volume/UploadVolumeCmdByAdmin.java
index f26e4650d16..bdac59a7de3 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/volume/UploadVolumeCmdByAdmin.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/volume/UploadVolumeCmdByAdmin.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.volume;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiErrorCode;
@@ -35,7 +36,7 @@
 @APICommand(name = "uploadVolume", description = "Uploads a data disk.", responseObject = VolumeResponse.class, responseView = ResponseView.Full, entityType = {Volume.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UploadVolumeCmdByAdmin extends UploadVolumeCmd {
-    public static final Logger s_logger = Logger.getLogger(UploadVolumeCmdByAdmin.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UploadVolumeCmdByAdmin.class.getName());
 
 
     @Override
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vpc/CreatePrivateGatewayCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vpc/CreatePrivateGatewayCmd.java
index d2a7ffb397a..b4f9216fb6e 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vpc/CreatePrivateGatewayCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vpc/CreatePrivateGatewayCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.vpc;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -46,7 +47,7 @@
 @APICommand(name = "createPrivateGateway", description = "Creates a private gateway", responseObject = PrivateGatewayResponse.class, entityType = {VpcGateway.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreatePrivateGatewayCmd extends BaseAsyncCreateCmd {
-    public static final Logger s_logger = Logger.getLogger(CreatePrivateGatewayCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreatePrivateGatewayCmd.class.getName());
 
     private static final String s_name = "createprivategatewayresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCCmdByAdmin.java
index a84a3aa5ec7..c01c10e1e92 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCCmdByAdmin.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCCmdByAdmin.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.vpc;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -34,7 +35,7 @@
 @APICommand(name = "createVPC", description = "Creates a VPC", responseObject = VpcResponse.class, responseView = ResponseView.Full, entityType = {Vpc.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreateVPCCmdByAdmin extends CreateVPCCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateVPCCmdByAdmin.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateVPCCmdByAdmin.class.getName());
 
     @Override
     public void execute() {
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCOfferingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCOfferingCmd.java
index 99c1719e1b6..93f46aaa407 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCOfferingCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCOfferingCmd.java
@@ -23,7 +23,8 @@
 import java.util.List;
 import java.util.Map;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -42,7 +43,7 @@
 @APICommand(name = "createVPCOffering", description = "Creates VPC offering", responseObject = VpcOfferingResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreateVPCOfferingCmd extends BaseAsyncCreateCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateVPCOfferingCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateVPCOfferingCmd.class.getName());
     private static final String s_name = "createvpcofferingresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vpc/DeletePrivateGatewayCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vpc/DeletePrivateGatewayCmd.java
index 8d67a4ed8c5..421efccd8bd 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vpc/DeletePrivateGatewayCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vpc/DeletePrivateGatewayCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.vpc;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -39,7 +40,7 @@
 @APICommand(name = "deletePrivateGateway", description = "Deletes a Private gateway", responseObject = SuccessResponse.class, entityType = {VpcGateway.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeletePrivateGatewayCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DeletePrivateGatewayCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeletePrivateGatewayCmd.class.getName());
     private static final String s_name = "deleteprivategatewayresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vpc/DeleteVPCOfferingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vpc/DeleteVPCOfferingCmd.java
index 0959f5f8c07..bc8943c75cd 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vpc/DeleteVPCOfferingCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vpc/DeleteVPCOfferingCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.vpc;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -33,7 +34,7 @@
 @APICommand(name = "deleteVPCOffering", description = "Deletes VPC offering", responseObject = SuccessResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteVPCOfferingCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteVPCOfferingCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteVPCOfferingCmd.class.getName());
     private static final String s_name = "deletevpcofferingresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vpc/ListVPCsCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/vpc/ListVPCsCmdByAdmin.java
index 20d77a7f686..76bb5454c79 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vpc/ListVPCsCmdByAdmin.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vpc/ListVPCsCmdByAdmin.java
@@ -24,7 +24,8 @@
 import org.apache.cloudstack.api.command.user.vpc.ListVPCsCmd;
 import org.apache.cloudstack.api.response.ListResponse;
 import org.apache.cloudstack.api.response.VpcResponse;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.network.vpc.Vpc;
 import com.cloud.utils.Pair;
@@ -33,7 +34,7 @@
 @APICommand(name = "listVPCs", description = "Lists VPCs", responseObject = VpcResponse.class, responseView = ResponseView.Full, entityType = {Vpc.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListVPCsCmdByAdmin extends ListVPCsCmd {
-    public static final Logger s_logger = Logger.getLogger(ListVPCsCmdByAdmin.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListVPCsCmdByAdmin.class.getName());
 
     @Override
     public void execute() {
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vpc/UpdateVPCCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/vpc/UpdateVPCCmdByAdmin.java
index 8606c32a71e..163465255d2 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vpc/UpdateVPCCmdByAdmin.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vpc/UpdateVPCCmdByAdmin.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.vpc;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiErrorCode;
@@ -30,7 +31,7 @@
 @APICommand(name = "updateVPC", description = "Updates a VPC", responseObject = VpcResponse.class, responseView = ResponseView.Full, entityType = {Vpc.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateVPCCmdByAdmin extends UpdateVPCCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateVPCCmdByAdmin.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateVPCCmdByAdmin.class.getName());
 
     @Override
     public void execute(){
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vpc/UpdateVPCOfferingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vpc/UpdateVPCOfferingCmd.java
index 5af47d3a4c7..35a96809a5f 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vpc/UpdateVPCOfferingCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vpc/UpdateVPCOfferingCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.vpc;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -33,7 +34,7 @@
 @APICommand(name = "updateVPCOffering", description = "Updates VPC offering", responseObject = VpcOfferingResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateVPCOfferingCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateVPCOfferingCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateVPCOfferingCmd.class.getName());
     private static final String s_name = "updatevpcofferingresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/admin/zone/CreateZoneCmd.java b/api/src/org/apache/cloudstack/api/command/admin/zone/CreateZoneCmd.java
index 414c058e66d..51949f09c76 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/zone/CreateZoneCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/zone/CreateZoneCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.zone;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -35,7 +36,7 @@
 @APICommand(name = "createZone", description = "Creates a Zone.", responseObject = ZoneResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreateZoneCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateZoneCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateZoneCmd.class.getName());
 
     private static final String s_name = "createzoneresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/zone/DeleteZoneCmd.java b/api/src/org/apache/cloudstack/api/command/admin/zone/DeleteZoneCmd.java
index c7029b052ec..7b9f0eb1c11 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/zone/DeleteZoneCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/zone/DeleteZoneCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.zone;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -33,7 +34,7 @@
 @APICommand(name = "deleteZone", description = "Deletes a Zone.", responseObject = SuccessResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteZoneCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteZoneCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteZoneCmd.class.getName());
 
     private static final String s_name = "deletezoneresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/zone/MarkDefaultZoneForAccountCmd.java b/api/src/org/apache/cloudstack/api/command/admin/zone/MarkDefaultZoneForAccountCmd.java
index 28a6d6ccc13..5e49fcc8b74 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/zone/MarkDefaultZoneForAccountCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/zone/MarkDefaultZoneForAccountCmd.java
@@ -17,7 +17,8 @@
 
 package org.apache.cloudstack.api.command.admin.zone;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -37,7 +38,7 @@
 @APICommand(name = "markDefaultZoneForAccount", description = "Marks a default zone for this account", responseObject = AccountResponse.class, since = "4.0",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class MarkDefaultZoneForAccountCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(MarkDefaultZoneForAccountCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(MarkDefaultZoneForAccountCmd.class.getName());
 
     private static final String s_name = "markdefaultzoneforaccountresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/admin/zone/UpdateZoneCmd.java b/api/src/org/apache/cloudstack/api/command/admin/zone/UpdateZoneCmd.java
index 9ad8972ecfd..87ca800af3b 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/zone/UpdateZoneCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/zone/UpdateZoneCmd.java
@@ -19,7 +19,8 @@
 import java.util.List;
 import java.util.Map;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -37,7 +38,7 @@
 @APICommand(name = "updateZone", description = "Updates a Zone.", responseObject = ZoneResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateZoneCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateZoneCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateZoneCmd.class.getName());
 
     private static final String s_name = "updatezoneresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/account/AddAccountToProjectCmd.java b/api/src/org/apache/cloudstack/api/command/user/account/AddAccountToProjectCmd.java
index 22deb035b51..efc350e2837 100644
--- a/api/src/org/apache/cloudstack/api/command/user/account/AddAccountToProjectCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/account/AddAccountToProjectCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.account;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -35,7 +36,7 @@
 @APICommand(name = "addAccountToProject", description = "Adds account to a project", responseObject = SuccessResponse.class, since = "3.0.0",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class AddAccountToProjectCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(AddAccountToProjectCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(AddAccountToProjectCmd.class.getName());
 
     private static final String s_name = "addaccounttoprojectresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/account/DeleteAccountFromProjectCmd.java b/api/src/org/apache/cloudstack/api/command/user/account/DeleteAccountFromProjectCmd.java
index 60003b7b8fd..130fa1548cc 100644
--- a/api/src/org/apache/cloudstack/api/command/user/account/DeleteAccountFromProjectCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/account/DeleteAccountFromProjectCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.account;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -36,7 +37,7 @@
 @APICommand(name = "deleteAccountFromProject", description = "Deletes account from the project", responseObject = SuccessResponse.class, since = "3.0.0",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteAccountFromProjectCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteProjectCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteProjectCmd.class.getName());
 
     private static final String s_name = "deleteaccountfromprojectresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/account/ListAccountsCmd.java b/api/src/org/apache/cloudstack/api/command/user/account/ListAccountsCmd.java
index 167f23306f2..550cb484681 100644
--- a/api/src/org/apache/cloudstack/api/command/user/account/ListAccountsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/account/ListAccountsCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.account;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -31,7 +32,7 @@
 @APICommand(name = "listAccounts", description = "Lists accounts and provides detailed account information for listed accounts", responseObject = AccountResponse.class, responseView = ResponseView.Restricted, entityType = {Account.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class ListAccountsCmd extends BaseListDomainResourcesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListAccountsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListAccountsCmd.class.getName());
     private static final String s_name = "listaccountsresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/account/ListProjectAccountsCmd.java b/api/src/org/apache/cloudstack/api/command/user/account/ListProjectAccountsCmd.java
index 3fcb1989fa5..7dc3bb9bc9d 100644
--- a/api/src/org/apache/cloudstack/api/command/user/account/ListProjectAccountsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/account/ListProjectAccountsCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.account;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -31,7 +32,7 @@
 @APICommand(name = "listProjectAccounts", description = "Lists project's accounts", responseObject = ProjectResponse.class, since = "3.0.0",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListProjectAccountsCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListProjectAccountsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListProjectAccountsCmd.class.getName());
 
     private static final String s_name = "listprojectaccountsresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java b/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java
index 15072ca9a4f..282ee86b5fb 100644
--- a/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java
@@ -18,7 +18,8 @@
 
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.api.APICommand;
@@ -60,7 +61,7 @@
 @APICommand(name = "associateIpAddress", description = "Acquires and associates a public IP to an account. Either of the parameters are required, i.e. either zoneId, or networkId, or vpcId  ", responseObject = IPAddressResponse.class, responseView = ResponseView.Restricted,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class AssociateIPAddrCmd extends BaseAsyncCreateCmd {
-    public static final Logger s_logger = Logger.getLogger(AssociateIPAddrCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(AssociateIPAddrCmd.class.getName());
     private static final String s_name = "associateipaddressresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/address/DisassociateIPAddrCmd.java b/api/src/org/apache/cloudstack/api/command/user/address/DisassociateIPAddrCmd.java
index c2e173c0fa5..864124fc9f0 100644
--- a/api/src/org/apache/cloudstack/api/command/user/address/DisassociateIPAddrCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/address/DisassociateIPAddrCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.address;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -39,7 +40,7 @@
 @APICommand(name = "disassociateIpAddress", description = "Disassociates an IP address from the account.", responseObject = SuccessResponse.class,
  requestHasSensitiveInfo = false, responseHasSensitiveInfo = false, entityType = { IpAddress.class })
 public class DisassociateIPAddrCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DisassociateIPAddrCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DisassociateIPAddrCmd.class.getName());
 
     private static final String s_name = "disassociateipaddressresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/address/ListPublicIpAddressesCmd.java b/api/src/org/apache/cloudstack/api/command/user/address/ListPublicIpAddressesCmd.java
index 0a0e7a12076..6ee5e27ed65 100644
--- a/api/src/org/apache/cloudstack/api/command/user/address/ListPublicIpAddressesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/address/ListPublicIpAddressesCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.api.APICommand;
@@ -42,7 +43,7 @@
 @APICommand(name = "listPublicIpAddresses", description = "Lists all public IP addresses", responseObject = IPAddressResponse.class, responseView = ResponseView.Restricted,
  requestHasSensitiveInfo = false, responseHasSensitiveInfo = false, entityType = { IpAddress.class })
 public class ListPublicIpAddressesCmd extends BaseListTaggedResourcesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListPublicIpAddressesCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListPublicIpAddressesCmd.class.getName());
 
     private static final String s_name = "listpublicipaddressesresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/address/UpdateIPAddrCmd.java b/api/src/org/apache/cloudstack/api/command/user/address/UpdateIPAddrCmd.java
index 6d20283984b..9711da314a0 100644
--- a/api/src/org/apache/cloudstack/api/command/user/address/UpdateIPAddrCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/address/UpdateIPAddrCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.address;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.api.APICommand;
@@ -41,7 +42,7 @@
 @APICommand(name = "updateIpAddress", description = "Updates an IP address", responseObject = IPAddressResponse.class,
  requestHasSensitiveInfo = false, responseHasSensitiveInfo = false, entityType = { IpAddress.class })
 public class UpdateIPAddrCmd extends BaseAsyncCustomIdCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateIPAddrCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateIPAddrCmd.class.getName());
     private static final String s_name = "updateipaddressresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/affinitygroup/CreateAffinityGroupCmd.java b/api/src/org/apache/cloudstack/api/command/user/affinitygroup/CreateAffinityGroupCmd.java
index 8cc3d69bb6b..7cdd482f0e0 100644
--- a/api/src/org/apache/cloudstack/api/command/user/affinitygroup/CreateAffinityGroupCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/affinitygroup/CreateAffinityGroupCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.affinitygroup;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.apache.cloudstack.affinity.AffinityGroup;
 import org.apache.cloudstack.affinity.AffinityGroupResponse;
 import org.apache.cloudstack.api.APICommand;
@@ -37,7 +38,7 @@
 @APICommand(name = "createAffinityGroup", responseObject = AffinityGroupResponse.class, description = "Creates an affinity/anti-affinity group", entityType = {AffinityGroup.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreateAffinityGroupCmd extends BaseAsyncCreateCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateAffinityGroupCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateAffinityGroupCmd.class.getName());
 
     private static final String s_name = "createaffinitygroupresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/affinitygroup/DeleteAffinityGroupCmd.java b/api/src/org/apache/cloudstack/api/command/user/affinitygroup/DeleteAffinityGroupCmd.java
index e8884b4f65c..78a0b1625eb 100644
--- a/api/src/org/apache/cloudstack/api/command/user/affinitygroup/DeleteAffinityGroupCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/affinitygroup/DeleteAffinityGroupCmd.java
@@ -18,7 +18,8 @@
 
 
 import org.apache.cloudstack.api.response.ProjectResponse;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.affinity.AffinityGroup;
 import org.apache.cloudstack.affinity.AffinityGroupResponse;
@@ -40,7 +41,7 @@
 @APICommand(name = "deleteAffinityGroup", description = "Deletes affinity group", responseObject = SuccessResponse.class, entityType = {AffinityGroup.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteAffinityGroupCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteAffinityGroupCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteAffinityGroupCmd.class.getName());
     private static final String s_name = "deleteaffinitygroupresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/affinitygroup/ListAffinityGroupTypesCmd.java b/api/src/org/apache/cloudstack/api/command/user/affinitygroup/ListAffinityGroupTypesCmd.java
index 84ad0328463..a48ec0ff44b 100644
--- a/api/src/org/apache/cloudstack/api/command/user/affinitygroup/ListAffinityGroupTypesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/affinitygroup/ListAffinityGroupTypesCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.affinity.AffinityGroupTypeResponse;
 import org.apache.cloudstack.api.APICommand;
@@ -31,7 +32,7 @@
 @APICommand(name = "listAffinityGroupTypes", description = "Lists affinity group types available", responseObject = AffinityGroupTypeResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListAffinityGroupTypesCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListAffinityGroupTypesCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListAffinityGroupTypesCmd.class.getName());
 
     private static final String s_name = "listaffinitygrouptypesresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/affinitygroup/ListAffinityGroupsCmd.java b/api/src/org/apache/cloudstack/api/command/user/affinitygroup/ListAffinityGroupsCmd.java
index fa7935b0b66..beb2348d5a8 100644
--- a/api/src/org/apache/cloudstack/api/command/user/affinitygroup/ListAffinityGroupsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/affinitygroup/ListAffinityGroupsCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.affinitygroup;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.affinity.AffinityGroup;
 import org.apache.cloudstack.affinity.AffinityGroupResponse;
@@ -31,7 +32,7 @@
 @APICommand(name = "listAffinityGroups", description = "Lists affinity groups", responseObject = AffinityGroupResponse.class, entityType = {AffinityGroup.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListAffinityGroupsCmd extends BaseListProjectAndAccountResourcesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListAffinityGroupsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListAffinityGroupsCmd.class.getName());
 
     private static final String s_name = "listaffinitygroupsresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/affinitygroup/UpdateVMAffinityGroupCmd.java b/api/src/org/apache/cloudstack/api/command/user/affinitygroup/UpdateVMAffinityGroupCmd.java
index 70850001cfc..b6ca77a56a5 100644
--- a/api/src/org/apache/cloudstack/api/command/user/affinitygroup/UpdateVMAffinityGroupCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/affinitygroup/UpdateVMAffinityGroupCmd.java
@@ -20,7 +20,8 @@
 import java.util.EnumSet;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.affinity.AffinityGroupResponse;
@@ -54,7 +55,7 @@
             requestHasSensitiveInfo = false,
             responseHasSensitiveInfo = true)
 public class UpdateVMAffinityGroupCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateVMAffinityGroupCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateVMAffinityGroupCmd.class.getName());
     private static final String s_name = "updatevirtualmachineresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScalePolicyCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScalePolicyCmd.java
index 6a2b491f2f4..1351f0368af 100644
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScalePolicyCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScalePolicyCmd.java
@@ -18,7 +18,8 @@
 
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -43,7 +44,7 @@
             requestHasSensitiveInfo = false,
             responseHasSensitiveInfo = false)
 public class CreateAutoScalePolicyCmd extends BaseAsyncCreateCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateAutoScalePolicyCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateAutoScalePolicyCmd.class.getName());
 
     private static final String s_name = "autoscalepolicyresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmGroupCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmGroupCmd.java
index 0308c1710c3..10ca9285867 100644
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmGroupCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmGroupCmd.java
@@ -18,7 +18,8 @@
 
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.api.APICommand;
@@ -45,7 +46,7 @@
             requestHasSensitiveInfo = false,
             responseHasSensitiveInfo = false)
 public class CreateAutoScaleVmGroupCmd extends BaseAsyncCreateCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateAutoScaleVmGroupCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateAutoScaleVmGroupCmd.class.getName());
 
     private static final String s_name = "autoscalevmgroupresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmProfileCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmProfileCmd.java
index 447085e79b5..43c27ee970e 100644
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmProfileCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmProfileCmd.java
@@ -19,7 +19,8 @@
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.api.APICommand;
@@ -50,7 +51,7 @@
             responseHasSensitiveInfo = false)
 @SuppressWarnings("rawtypes")
 public class CreateAutoScaleVmProfileCmd extends BaseAsyncCreateCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateAutoScaleVmProfileCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateAutoScaleVmProfileCmd.class.getName());
 
     private static final String s_name = "autoscalevmprofileresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateConditionCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateConditionCmd.java
index 847866ef3ae..e28f2257548 100644
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateConditionCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateConditionCmd.java
@@ -17,7 +17,8 @@
 
 package org.apache.cloudstack.api.command.user.autoscale;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -38,7 +39,7 @@
 @APICommand(name = "createCondition", description = "Creates a condition", responseObject = ConditionResponse.class, entityType = {Condition.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreateConditionCmd extends BaseAsyncCreateCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateConditionCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateConditionCmd.class.getName());
     private static final String s_name = "conditionresponse";
 
     // ///////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteAutoScalePolicyCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteAutoScalePolicyCmd.java
index c0a3a00f7d4..6f294b98554 100644
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteAutoScalePolicyCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteAutoScalePolicyCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.autoscale;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -38,7 +39,7 @@
 @APICommand(name = "deleteAutoScalePolicy", description = "Deletes a autoscale policy.", responseObject = SuccessResponse.class, entityType = {AutoScalePolicy.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteAutoScalePolicyCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteAutoScalePolicyCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteAutoScalePolicyCmd.class.getName());
     private static final String s_name = "deleteautoscalepolicyresponse";
     // ///////////////////////////////////////////////////
     // ////////////// API parameters /////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteAutoScaleVmGroupCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteAutoScaleVmGroupCmd.java
index a9d2f4e2329..87c0123532c 100644
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteAutoScaleVmGroupCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteAutoScaleVmGroupCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.autoscale;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -38,7 +39,7 @@
 @APICommand(name = "deleteAutoScaleVmGroup", description = "Deletes a autoscale vm group.", responseObject = SuccessResponse.class, entityType = {AutoScaleVmGroup.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteAutoScaleVmGroupCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteAutoScaleVmGroupCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteAutoScaleVmGroupCmd.class.getName());
     private static final String s_name = "deleteautoscalevmgroupresponse";
     // ///////////////////////////////////////////////////
     // ////////////// API parameters /////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteAutoScaleVmProfileCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteAutoScaleVmProfileCmd.java
index 779315a96dd..8050230fcbf 100644
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteAutoScaleVmProfileCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteAutoScaleVmProfileCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.autoscale;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -38,7 +39,7 @@
 @APICommand(name = "deleteAutoScaleVmProfile", description = "Deletes a autoscale vm profile.", responseObject = SuccessResponse.class, entityType = {AutoScaleVmProfile.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteAutoScaleVmProfileCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteAutoScaleVmProfileCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteAutoScaleVmProfileCmd.class.getName());
     private static final String s_name = "deleteautoscalevmprofileresponse";
     // ///////////////////////////////////////////////////
     // ////////////// API parameters /////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteConditionCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteConditionCmd.java
index 24f4cc68784..04c1320fe15 100644
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteConditionCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteConditionCmd.java
@@ -17,7 +17,8 @@
 
 package org.apache.cloudstack.api.command.user.autoscale;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -39,7 +40,7 @@
 @APICommand(name = "deleteCondition", description = "Removes a condition", responseObject = SuccessResponse.class, entityType = {Condition.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteConditionCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteConditionCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteConditionCmd.class.getName());
     private static final String s_name = "deleteconditionresponse";
 
     // ///////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/DisableAutoScaleVmGroupCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/DisableAutoScaleVmGroupCmd.java
index 8eb1809f887..8e1be5627ab 100644
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/DisableAutoScaleVmGroupCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/DisableAutoScaleVmGroupCmd.java
@@ -17,7 +17,8 @@
 
 package org.apache.cloudstack.api.command.user.autoscale;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -37,7 +38,7 @@
 @APICommand(name = "disableAutoScaleVmGroup", description = "Disables an AutoScale Vm Group", responseObject = AutoScaleVmGroupResponse.class, entityType = {AutoScaleVmGroup.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DisableAutoScaleVmGroupCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DisableAutoScaleVmGroupCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DisableAutoScaleVmGroupCmd.class.getName());
     private static final String s_name = "disableautoscalevmGroupresponse";
 
     // ///////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/EnableAutoScaleVmGroupCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/EnableAutoScaleVmGroupCmd.java
index 59c9f7a9aa3..9001c947776 100644
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/EnableAutoScaleVmGroupCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/EnableAutoScaleVmGroupCmd.java
@@ -17,7 +17,8 @@
 
 package org.apache.cloudstack.api.command.user.autoscale;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -37,7 +38,7 @@
 @APICommand(name = "enableAutoScaleVmGroup", description = "Enables an AutoScale Vm Group", responseObject = AutoScaleVmGroupResponse.class, entityType = {AutoScaleVmGroup.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class EnableAutoScaleVmGroupCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(EnableAutoScaleVmGroupCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(EnableAutoScaleVmGroupCmd.class.getName());
     private static final String s_name = "enableautoscalevmGroupresponse";
 
     // ///////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScalePoliciesCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScalePoliciesCmd.java
index c2b244f2a7f..edac473c7b7 100644
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScalePoliciesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScalePoliciesCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -35,7 +36,7 @@
 @APICommand(name = "listAutoScalePolicies", description = "Lists autoscale policies.", responseObject = AutoScalePolicyResponse.class, entityType = {AutoScalePolicy.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListAutoScalePoliciesCmd extends BaseListAccountResourcesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListAutoScalePoliciesCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListAutoScalePoliciesCmd.class.getName());
 
     private static final String s_name = "listautoscalepoliciesresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScaleVmGroupsCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScaleVmGroupsCmd.java
index 37c90b9bfdb..99e34ea06a9 100644
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScaleVmGroupsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScaleVmGroupsCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.api.APICommand;
@@ -39,7 +40,7 @@
 @APICommand(name = "listAutoScaleVmGroups", description = "Lists autoscale vm groups.", responseObject = AutoScaleVmGroupResponse.class, entityType = {AutoScaleVmGroup.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListAutoScaleVmGroupsCmd extends BaseListProjectAndAccountResourcesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListAutoScaleVmGroupsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListAutoScaleVmGroupsCmd.class.getName());
 
     private static final String s_name = "listautoscalevmgroupsresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScaleVmProfilesCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScaleVmProfilesCmd.java
index 554b48854a4..003b4b35477 100644
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScaleVmProfilesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScaleVmProfilesCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.api.APICommand;
@@ -37,7 +38,7 @@
 @APICommand(name = "listAutoScaleVmProfiles", description = "Lists autoscale vm profiles.", responseObject = AutoScaleVmProfileResponse.class, entityType = {AutoScaleVmProfile.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListAutoScaleVmProfilesCmd extends BaseListProjectAndAccountResourcesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListAutoScaleVmProfilesCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListAutoScaleVmProfilesCmd.class.getName());
 
     private static final String s_name = "listautoscalevmprofilesresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/ListConditionsCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/ListConditionsCmd.java
index d75d64942f9..2d5ee6403a7 100644
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/ListConditionsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/ListConditionsCmd.java
@@ -20,7 +20,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -36,7 +37,7 @@
 @APICommand(name = "listConditions", description = "List Conditions for the specific user", responseObject = ConditionResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListConditionsCmd extends BaseListAccountResourcesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListConditionsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListConditionsCmd.class.getName());
     private static final String s_name = "listconditionsresponse";
 
     // ///////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/ListCountersCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/ListCountersCmd.java
index 6a9ac8dfdcb..6e2ca3f34ea 100644
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/ListCountersCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/ListCountersCmd.java
@@ -20,7 +20,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -35,7 +36,7 @@
 @APICommand(name = "listCounters", description = "List the counters", responseObject = CounterResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListCountersCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListCountersCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListCountersCmd.class.getName());
     private static final String s_name = "counterresponse";
 
     // ///////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScalePolicyCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScalePolicyCmd.java
index 24858f4656b..d21b21c1bdc 100644
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScalePolicyCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScalePolicyCmd.java
@@ -19,7 +19,8 @@
 
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -41,7 +42,7 @@
 @APICommand(name = "updateAutoScalePolicy", description = "Updates an existing autoscale policy.", responseObject = AutoScalePolicyResponse.class, entityType = {AutoScalePolicy.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateAutoScalePolicyCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateAutoScalePolicyCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateAutoScalePolicyCmd.class.getName());
 
     private static final String s_name = "updateautoscalepolicyresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScaleVmGroupCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScaleVmGroupCmd.java
index 76fa3d75d18..ebb7f982f44 100644
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScaleVmGroupCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScaleVmGroupCmd.java
@@ -19,7 +19,8 @@
 
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
@@ -42,7 +43,7 @@
 @APICommand(name = "updateAutoScaleVmGroup", description = "Updates an existing autoscale vm group.", responseObject = AutoScaleVmGroupResponse.class, entityType = {AutoScaleVmGroup.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateAutoScaleVmGroupCmd extends BaseAsyncCustomIdCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateAutoScaleVmGroupCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateAutoScaleVmGroupCmd.class.getName());
 
     private static final String s_name = "updateautoscalevmgroupresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScaleVmProfileCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScaleVmProfileCmd.java
index deebe2ecc9a..cf1a9139b3c 100644
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScaleVmProfileCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScaleVmProfileCmd.java
@@ -19,7 +19,8 @@
 
 import java.util.Map;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
@@ -43,7 +44,7 @@
 @APICommand(name = "updateAutoScaleVmProfile", description = "Updates an existing autoscale vm profile.", responseObject = AutoScaleVmProfileResponse.class, entityType = {AutoScaleVmProfile.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateAutoScaleVmProfileCmd extends BaseAsyncCustomIdCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateAutoScaleVmProfileCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateAutoScaleVmProfileCmd.class.getName());
 
     private static final String s_name = "updateautoscalevmprofileresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/config/ListCapabilitiesCmd.java b/api/src/org/apache/cloudstack/api/command/user/config/ListCapabilitiesCmd.java
index 9c526563d44..664add67f2a 100644
--- a/api/src/org/apache/cloudstack/api/command/user/config/ListCapabilitiesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/config/ListCapabilitiesCmd.java
@@ -21,14 +21,15 @@
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.BaseCmd;
 import org.apache.cloudstack.api.response.CapabilitiesResponse;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.user.Account;
 
 @APICommand(name = "listCapabilities", description = "Lists capabilities", responseObject = CapabilitiesResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListCapabilitiesCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(ListCapabilitiesCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListCapabilitiesCmd.class.getName());
 
     private static final String s_name = "listcapabilitiesresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/event/ArchiveEventsCmd.java b/api/src/org/apache/cloudstack/api/command/user/event/ArchiveEventsCmd.java
index e4970d6530e..28f75870491 100644
--- a/api/src/org/apache/cloudstack/api/command/user/event/ArchiveEventsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/event/ArchiveEventsCmd.java
@@ -19,7 +19,8 @@
 import java.util.Date;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -39,7 +40,7 @@
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ArchiveEventsCmd extends BaseCmd {
 
-    public static final Logger s_logger = Logger.getLogger(ArchiveEventsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ArchiveEventsCmd.class.getName());
 
     private static final String s_name = "archiveeventsresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/event/DeleteEventsCmd.java b/api/src/org/apache/cloudstack/api/command/user/event/DeleteEventsCmd.java
index defb0096962..b2e610c132c 100644
--- a/api/src/org/apache/cloudstack/api/command/user/event/DeleteEventsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/event/DeleteEventsCmd.java
@@ -19,7 +19,8 @@
 import java.util.Date;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -39,7 +40,7 @@
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteEventsCmd extends BaseCmd {
 
-    public static final Logger s_logger = Logger.getLogger(DeleteEventsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteEventsCmd.class.getName());
 
     private static final String s_name = "deleteeventsresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/event/ListEventTypesCmd.java b/api/src/org/apache/cloudstack/api/command/user/event/ListEventTypesCmd.java
index 91f316c3d00..e905b6b00de 100644
--- a/api/src/org/apache/cloudstack/api/command/user/event/ListEventTypesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/event/ListEventTypesCmd.java
@@ -18,7 +18,8 @@
 
 import java.util.ArrayList;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.BaseCmd;
@@ -30,7 +31,7 @@
 @APICommand(name = "listEventTypes", description = "List Event Types", responseObject = EventTypeResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListEventTypesCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(ListEventTypesCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListEventTypesCmd.class.getName());
     private static final String s_name = "listeventtypesresponse";
 
     @Override
diff --git a/api/src/org/apache/cloudstack/api/command/user/event/ListEventsCmd.java b/api/src/org/apache/cloudstack/api/command/user/event/ListEventsCmd.java
index a4934fa1dd9..d6ac8763fdc 100644
--- a/api/src/org/apache/cloudstack/api/command/user/event/ListEventsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/event/ListEventsCmd.java
@@ -18,7 +18,8 @@
 
 import java.util.Date;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -32,7 +33,7 @@
 @APICommand(name = "listEvents", description = "A command to list events.", responseObject = EventResponse.class, entityType = {Event.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListEventsCmd extends BaseListProjectAndAccountResourcesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListEventsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListEventsCmd.class.getName());
 
     private static final String s_name = "listeventsresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/CreateEgressFirewallRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/CreateEgressFirewallRuleCmd.java
index 1f14abf4a5a..39a9fbb6083 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/CreateEgressFirewallRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/CreateEgressFirewallRuleCmd.java
@@ -20,7 +20,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.api.APICommand;
@@ -47,7 +48,7 @@
 @APICommand(name = "createEgressFirewallRule", description = "Creates a egress firewall rule for a given network ", responseObject = FirewallResponse.class, entityType = {FirewallRule.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreateEgressFirewallRuleCmd extends BaseAsyncCreateCmd implements FirewallRule {
-    public static final Logger s_logger = Logger.getLogger(CreateEgressFirewallRuleCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateEgressFirewallRuleCmd.class.getName());
 
     private static final String s_name = "createegressfirewallruleresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/CreateFirewallRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/CreateFirewallRuleCmd.java
index 548b81447fe..5c134ffac30 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/CreateFirewallRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/CreateFirewallRuleCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.api.APICommand;
@@ -46,7 +47,7 @@
 @APICommand(name = "createFirewallRule", description = "Creates a firewall rule for a given IP address", responseObject = FirewallResponse.class, entityType = {FirewallRule.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreateFirewallRuleCmd extends BaseAsyncCreateCmd implements FirewallRule {
-    public static final Logger s_logger = Logger.getLogger(CreateFirewallRuleCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateFirewallRuleCmd.class.getName());
 
     private static final String s_name = "createfirewallruleresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java
index 69360608df1..70ae9ebe7bb 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java
@@ -18,7 +18,8 @@
 
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
@@ -54,7 +55,7 @@
         VirtualMachine.class, IpAddress.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreatePortForwardingRuleCmd extends BaseAsyncCreateCmd implements PortForwardingRule {
-    public static final Logger s_logger = Logger.getLogger(CreatePortForwardingRuleCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreatePortForwardingRuleCmd.class.getName());
 
     private static final String s_name = "createportforwardingruleresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteEgressFirewallRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteEgressFirewallRuleCmd.java
index 59a0519df4d..8b165756892 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteEgressFirewallRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteEgressFirewallRuleCmd.java
@@ -17,7 +17,8 @@
 
 package org.apache.cloudstack.api.command.user.firewall;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -41,7 +42,7 @@
 @APICommand(name = "deleteEgressFirewallRule", description = "Deletes an egress firewall rule", responseObject = SuccessResponse.class, entityType = {FirewallRule.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteEgressFirewallRuleCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteEgressFirewallRuleCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteEgressFirewallRuleCmd.class.getName());
     private static final String s_name = "deleteegressfirewallruleresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteFirewallRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteFirewallRuleCmd.java
index ba8b18eacf0..f1445eaeccf 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteFirewallRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteFirewallRuleCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.firewall;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -40,7 +41,7 @@
 @APICommand(name = "deleteFirewallRule", description = "Deletes a firewall rule", responseObject = SuccessResponse.class, entityType = {FirewallRule.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteFirewallRuleCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteFirewallRuleCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteFirewallRuleCmd.class.getName());
     private static final String s_name = "deletefirewallruleresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/DeletePortForwardingRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/DeletePortForwardingRuleCmd.java
index 1c45280a837..a1ec526af6d 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/DeletePortForwardingRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/DeletePortForwardingRuleCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.firewall;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -39,7 +40,7 @@
 @APICommand(name = "deletePortForwardingRule", description = "Deletes a port forwarding rule", responseObject = SuccessResponse.class, entityType = {PortForwardingRule.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeletePortForwardingRuleCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DeletePortForwardingRuleCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeletePortForwardingRuleCmd.class.getName());
     private static final String s_name = "deleteportforwardingruleresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/ListEgressFirewallRulesCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/ListEgressFirewallRulesCmd.java
index 3664031d550..874c56237b6 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/ListEgressFirewallRulesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/ListEgressFirewallRulesCmd.java
@@ -20,7 +20,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.api.APICommand;
@@ -39,7 +40,7 @@
 @APICommand(name = "listEgressFirewallRules", description = "Lists all egress firewall rules for network ID.", responseObject = FirewallResponse.class, entityType = {FirewallRule.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListEgressFirewallRulesCmd extends BaseListTaggedResourcesCmd implements IListFirewallRulesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListEgressFirewallRulesCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListEgressFirewallRulesCmd.class.getName());
     private static final String s_name = "listegressfirewallrulesresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/ListFirewallRulesCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/ListFirewallRulesCmd.java
index 3c3feeabfe1..9d9ea813a29 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/ListFirewallRulesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/ListFirewallRulesCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.api.APICommand;
@@ -38,7 +39,7 @@
 @APICommand(name = "listFirewallRules", description = "Lists all firewall rules for an IP address.", responseObject = FirewallResponse.class, entityType = {FirewallRule.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListFirewallRulesCmd extends BaseListTaggedResourcesCmd implements IListFirewallRulesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListFirewallRulesCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListFirewallRulesCmd.class.getName());
     private static final String s_name = "listfirewallrulesresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/ListPortForwardingRulesCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/ListPortForwardingRulesCmd.java
index d5c49a9a4d2..2379e1591e4 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/ListPortForwardingRulesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/ListPortForwardingRulesCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.api.APICommand;
@@ -37,7 +38,7 @@
 @APICommand(name = "listPortForwardingRules", description = "Lists all port forwarding rules for an IP address.", responseObject = FirewallRuleResponse.class, entityType = {PortForwardingRule.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListPortForwardingRulesCmd extends BaseListTaggedResourcesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListPortForwardingRulesCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListPortForwardingRulesCmd.class.getName());
 
     private static final String s_name = "listportforwardingrulesresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/UpdateEgressFirewallRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/UpdateEgressFirewallRuleCmd.java
index ddaaf7135b4..e2d2d895cef 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/UpdateEgressFirewallRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/UpdateEgressFirewallRuleCmd.java
@@ -26,7 +26,8 @@
 import org.apache.cloudstack.api.response.FirewallResponse;
 import org.apache.cloudstack.api.response.FirewallRuleResponse;
 import org.apache.cloudstack.context.CallContext;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.event.EventTypes;
 import com.cloud.exception.InvalidParameterValueException;
@@ -37,7 +38,7 @@
 @APICommand(name = "updateEgressFirewallRule", description = "Updates egress firewall rule ", responseObject = FirewallResponse.class, since = "4.4",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateEgressFirewallRuleCmd extends BaseAsyncCustomIdCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateEgressFirewallRuleCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateEgressFirewallRuleCmd.class.getName());
 
     private static final String s_name = "updateegressfirewallruleresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/UpdateFirewallRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/UpdateFirewallRuleCmd.java
index 3d11ed0f3f5..2d20a305e13 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/UpdateFirewallRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/UpdateFirewallRuleCmd.java
@@ -26,7 +26,8 @@
 import org.apache.cloudstack.api.response.FirewallResponse;
 import org.apache.cloudstack.api.response.FirewallRuleResponse;
 import org.apache.cloudstack.context.CallContext;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.event.EventTypes;
 import com.cloud.exception.InvalidParameterValueException;
@@ -37,7 +38,7 @@
 @APICommand(name = "updateFirewallRule", description = "Updates firewall rule ", responseObject = FirewallResponse.class, since = "4.4",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateFirewallRuleCmd extends BaseAsyncCustomIdCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateFirewallRuleCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateFirewallRuleCmd.class.getName());
 
     private static final String s_name = "updatefirewallruleresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/UpdatePortForwardingRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/UpdatePortForwardingRuleCmd.java
index 7de50761630..c8d4c40fd03 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/UpdatePortForwardingRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/UpdatePortForwardingRuleCmd.java
@@ -24,7 +24,8 @@
 import org.apache.cloudstack.api.Parameter;
 import org.apache.cloudstack.api.response.FirewallRuleResponse;
 import org.apache.cloudstack.api.response.UserVmResponse;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.event.EventTypes;
 import com.cloud.exception.InvalidParameterValueException;
@@ -38,7 +39,7 @@
         description = "Updates a port forwarding rule. Only the private port and the virtual machine can be updated.", entityType = {PortForwardingRule.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdatePortForwardingRuleCmd extends BaseAsyncCustomIdCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdatePortForwardingRuleCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdatePortForwardingRuleCmd.class.getName());
     private static final String s_name = "updateportforwardingruleresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/guest/ListGuestOsCategoriesCmd.java b/api/src/org/apache/cloudstack/api/command/user/guest/ListGuestOsCategoriesCmd.java
index e82e3c45d1f..8774b8d3a9a 100644
--- a/api/src/org/apache/cloudstack/api/command/user/guest/ListGuestOsCategoriesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/guest/ListGuestOsCategoriesCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -35,7 +36,7 @@
 @APICommand(name = "listOsCategories", description = "Lists all supported OS categories for this cloud.", responseObject = GuestOSCategoryResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListGuestOsCategoriesCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListIsosCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListIsosCmd.class.getName());
 
     private static final String s_name = "listoscategoriesresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/guest/ListGuestOsCmd.java b/api/src/org/apache/cloudstack/api/command/user/guest/ListGuestOsCmd.java
index 15a625abfaa..6782da740c7 100644
--- a/api/src/org/apache/cloudstack/api/command/user/guest/ListGuestOsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/guest/ListGuestOsCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -36,7 +37,7 @@
 @APICommand(name = "listOsTypes", description = "Lists all supported OS types for this cloud.", responseObject = GuestOSResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListGuestOsCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListIsosCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListIsosCmd.class.getName());
 
     private static final String s_name = "listostypesresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/iso/AttachIsoCmd.java b/api/src/org/apache/cloudstack/api/command/user/iso/AttachIsoCmd.java
index c1d67e5ae2f..a16f601f3fa 100644
--- a/api/src/org/apache/cloudstack/api/command/user/iso/AttachIsoCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/iso/AttachIsoCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.iso;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -37,7 +38,7 @@
 @APICommand(name = "attachIso", description = "Attaches an ISO to a virtual machine.", responseObject = UserVmResponse.class, responseView = ResponseView.Restricted,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class AttachIsoCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(AttachIsoCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(AttachIsoCmd.class.getName());
 
     private static final String s_name = "attachisoresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/iso/CopyIsoCmd.java b/api/src/org/apache/cloudstack/api/command/user/iso/CopyIsoCmd.java
index b7c13ce4adb..72c765ffa21 100644
--- a/api/src/org/apache/cloudstack/api/command/user/iso/CopyIsoCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/iso/CopyIsoCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.iso;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ResponseObject.ResponseView;
@@ -26,6 +27,6 @@
 @APICommand(name = "copyIso", description = "Copies an ISO from one zone to another.", responseObject = TemplateResponse.class, responseView = ResponseView.Restricted,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CopyIsoCmd extends CopyTemplateCmd {
-    public static final Logger s_logger = Logger.getLogger(CopyIsoCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CopyIsoCmd.class.getName());
     private static final String s_name = "copyisoresponse";
 }
diff --git a/api/src/org/apache/cloudstack/api/command/user/iso/DeleteIsoCmd.java b/api/src/org/apache/cloudstack/api/command/user/iso/DeleteIsoCmd.java
index 103e9227c24..19b9d36333c 100644
--- a/api/src/org/apache/cloudstack/api/command/user/iso/DeleteIsoCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/iso/DeleteIsoCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.iso;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -37,7 +38,7 @@
 @APICommand(name = "deleteIso", description = "Deletes an ISO file.", responseObject = SuccessResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteIsoCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteIsoCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteIsoCmd.class.getName());
     private static final String s_name = "deleteisoresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/iso/DetachIsoCmd.java b/api/src/org/apache/cloudstack/api/command/user/iso/DetachIsoCmd.java
index 9ee8ef59c47..6769fac13fd 100644
--- a/api/src/org/apache/cloudstack/api/command/user/iso/DetachIsoCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/iso/DetachIsoCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.iso;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -35,7 +36,7 @@
 @APICommand(name = "detachIso", description = "Detaches any ISO file (if any) currently attached to a virtual machine.", responseObject = UserVmResponse.class, responseView = ResponseView.Restricted,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class DetachIsoCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DetachIsoCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DetachIsoCmd.class.getName());
 
     private static final String s_name = "detachisoresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/iso/ExtractIsoCmd.java b/api/src/org/apache/cloudstack/api/command/user/iso/ExtractIsoCmd.java
index a400a014b6b..eeba2392829 100644
--- a/api/src/org/apache/cloudstack/api/command/user/iso/ExtractIsoCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/iso/ExtractIsoCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.iso;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -38,7 +39,7 @@
 @APICommand(name = "extractIso", description = "Extracts an ISO", responseObject = ExtractResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ExtractIsoCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(ExtractIsoCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ExtractIsoCmd.class.getName());
 
     private static final String s_name = "extractisoresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/iso/ListIsoPermissionsCmd.java b/api/src/org/apache/cloudstack/api/command/user/iso/ListIsoPermissionsCmd.java
index 9a3db4300bf..7834cf446ea 100644
--- a/api/src/org/apache/cloudstack/api/command/user/iso/ListIsoPermissionsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/iso/ListIsoPermissionsCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.iso;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.BaseListTemplateOrIsoPermissionsCmd;
@@ -41,7 +42,7 @@ public String getMediaType() {
 
     @Override
     protected Logger getLogger() {
-        return Logger.getLogger(ListIsoPermissionsCmd.class.getName());
+        return LogManager.getLogger(ListIsoPermissionsCmd.class.getName());
     }
 
     @Override
diff --git a/api/src/org/apache/cloudstack/api/command/user/iso/ListIsosCmd.java b/api/src/org/apache/cloudstack/api/command/user/iso/ListIsosCmd.java
index dee60f4f8d5..d0d5c9b18b4 100644
--- a/api/src/org/apache/cloudstack/api/command/user/iso/ListIsosCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/iso/ListIsosCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.iso;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -35,7 +36,7 @@
 @APICommand(name = "listIsos", description = "Lists all available ISO files.", responseObject = TemplateResponse.class, responseView = ResponseView.Restricted,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListIsosCmd extends BaseListTaggedResourcesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListIsosCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListIsosCmd.class.getName());
 
     private static final String s_name = "listisosresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/iso/RegisterIsoCmd.java b/api/src/org/apache/cloudstack/api/command/user/iso/RegisterIsoCmd.java
index 3112287fb9c..269c29650b5 100644
--- a/api/src/org/apache/cloudstack/api/command/user/iso/RegisterIsoCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/iso/RegisterIsoCmd.java
@@ -32,7 +32,8 @@
 import org.apache.cloudstack.api.response.TemplateResponse;
 import org.apache.cloudstack.api.response.ZoneResponse;
 import org.apache.cloudstack.context.CallContext;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.exception.ResourceAllocationException;
 import com.cloud.template.VirtualMachineTemplate;
@@ -40,7 +41,7 @@
 @APICommand(name = "registerIso", responseObject = TemplateResponse.class, description = "Registers an existing ISO into the CloudStack Cloud.", responseView = ResponseView.Restricted,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class RegisterIsoCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(RegisterIsoCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(RegisterIsoCmd.class.getName());
 
     private static final String s_name = "registerisoresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/iso/UpdateIsoCmd.java b/api/src/org/apache/cloudstack/api/command/user/iso/UpdateIsoCmd.java
index ccf5b8abe51..71a0ea1a9e6 100644
--- a/api/src/org/apache/cloudstack/api/command/user/iso/UpdateIsoCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/iso/UpdateIsoCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.iso;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiErrorCode;
@@ -31,7 +32,7 @@
 @APICommand(name = "updateIso", description = "Updates an ISO file.", responseObject = TemplateResponse.class, responseView = ResponseView.Restricted,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateIsoCmd extends BaseUpdateTemplateOrIsoCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateIsoCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateIsoCmd.class.getName());
     private static final String s_name = "updateisoresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/iso/UpdateIsoPermissionsCmd.java b/api/src/org/apache/cloudstack/api/command/user/iso/UpdateIsoPermissionsCmd.java
index dd07faf9a87..01b58a6df18 100644
--- a/api/src/org/apache/cloudstack/api/command/user/iso/UpdateIsoPermissionsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/iso/UpdateIsoPermissionsCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.iso;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.BaseUpdateTemplateOrIsoPermissionsCmd;
@@ -35,7 +36,7 @@ protected String getResponseName() {
 
     @Override
     protected Logger getLogger() {
-        return Logger.getLogger(UpdateIsoPermissionsCmd.class.getName());
+        return LogManager.getLogger(UpdateIsoPermissionsCmd.class.getName());
     }
 
     @Override
diff --git a/api/src/org/apache/cloudstack/api/command/user/job/QueryAsyncJobResultCmd.java b/api/src/org/apache/cloudstack/api/command/user/job/QueryAsyncJobResultCmd.java
index fc46300a7ac..954689e6710 100644
--- a/api/src/org/apache/cloudstack/api/command/user/job/QueryAsyncJobResultCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/job/QueryAsyncJobResultCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.job;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -29,7 +30,7 @@
 @APICommand(name = "queryAsyncJobResult", description = "Retrieves the current status of asynchronous job.", responseObject = AsyncJobResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class QueryAsyncJobResultCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(QueryAsyncJobResultCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(QueryAsyncJobResultCmd.class.getName());
 
     private static final String s_name = "queryasyncjobresultresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignCertToLoadBalancerCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignCertToLoadBalancerCmd.java
index 663815106e5..2bb8bf3b938 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignCertToLoadBalancerCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignCertToLoadBalancerCmd.java
@@ -17,7 +17,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.loadbalancer;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -42,7 +43,7 @@
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class AssignCertToLoadBalancerCmd extends BaseAsyncCmd {
 
-    public static final Logger s_logger = Logger.getLogger(AssignCertToLoadBalancerCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(AssignCertToLoadBalancerCmd.class.getName());
 
     private static final String s_name = "assigncerttoloadbalancerresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignToLoadBalancerRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignToLoadBalancerRuleCmd.java
index fdc8a31c59a..c6ff504709c 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignToLoadBalancerRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignToLoadBalancerRuleCmd.java
@@ -24,7 +24,8 @@
 import java.util.Map;
 
 import com.cloud.utils.exception.CloudRuntimeException;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -51,7 +52,7 @@
             requestHasSensitiveInfo = false,
             responseHasSensitiveInfo = false)
 public class AssignToLoadBalancerRuleCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(AssignToLoadBalancerRuleCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(AssignToLoadBalancerRuleCmd.class.getName());
 
     private static final String s_name = "assigntoloadbalancerruleresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateApplicationLoadBalancerCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateApplicationLoadBalancerCmd.java
index 4e31c6abf34..f863a983dbe 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateApplicationLoadBalancerCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateApplicationLoadBalancerCmd.java
@@ -28,7 +28,8 @@
 import org.apache.cloudstack.api.response.NetworkResponse;
 import org.apache.cloudstack.context.CallContext;
 import org.apache.cloudstack.network.lb.ApplicationLoadBalancerRule;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.event.EventTypes;
 import com.cloud.exception.InsufficientAddressCapacityException;
@@ -44,7 +45,7 @@
 @APICommand(name = "createLoadBalancer", description = "Creates a load balancer", responseObject = ApplicationLoadBalancerResponse.class, since = "4.2.0",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreateApplicationLoadBalancerCmd extends BaseAsyncCreateCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateApplicationLoadBalancerCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateApplicationLoadBalancerCmd.class.getName());
 
     private static final String s_name = "createloadbalancerresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLBHealthCheckPolicyCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLBHealthCheckPolicyCmd.java
index 94c5324c23e..de872d39fe8 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLBHealthCheckPolicyCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLBHealthCheckPolicyCmd.java
@@ -26,7 +26,8 @@
 import org.apache.cloudstack.api.response.FirewallRuleResponse;
 import org.apache.cloudstack.api.response.LBHealthCheckResponse;
 import org.apache.cloudstack.context.CallContext;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.event.EventTypes;
 import com.cloud.exception.InvalidParameterValueException;
@@ -44,7 +45,7 @@
             responseHasSensitiveInfo = false)
 @SuppressWarnings("rawtypes")
 public class CreateLBHealthCheckPolicyCmd extends BaseAsyncCreateCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateLBHealthCheckPolicyCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateLBHealthCheckPolicyCmd.class.getName());
 
     private static final String s_name = "createlbhealthcheckpolicyresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLBStickinessPolicyCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLBStickinessPolicyCmd.java
index 45e6f81a0aa..0679a3f9141 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLBStickinessPolicyCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLBStickinessPolicyCmd.java
@@ -29,7 +29,8 @@
 import org.apache.cloudstack.api.response.FirewallRuleResponse;
 import org.apache.cloudstack.api.response.LBStickinessResponse;
 import org.apache.cloudstack.context.CallContext;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.event.EventTypes;
 import com.cloud.exception.InvalidParameterValueException;
@@ -44,7 +45,7 @@
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 @SuppressWarnings("rawtypes")
 public class CreateLBStickinessPolicyCmd extends BaseAsyncCreateCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateLBStickinessPolicyCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateLBStickinessPolicyCmd.class.getName());
 
     private static final String s_name = "createLBStickinessPolicy";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLoadBalancerRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLoadBalancerRuleCmd.java
index f9367652bdb..424991a9106 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLoadBalancerRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLoadBalancerRuleCmd.java
@@ -33,7 +33,8 @@
 import org.apache.cloudstack.api.response.NetworkResponse;
 import org.apache.cloudstack.api.response.ZoneResponse;
 import org.apache.cloudstack.context.CallContext;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.dc.DataCenter;
 import com.cloud.dc.DataCenter.NetworkType;
@@ -52,7 +53,7 @@
 @APICommand(name = "createLoadBalancerRule", description = "Creates a load balancer rule", responseObject = LoadBalancerResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreateLoadBalancerRuleCmd extends BaseAsyncCreateCmd /*implements LoadBalancer */{
-    public static final Logger s_logger = Logger.getLogger(CreateLoadBalancerRuleCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateLoadBalancerRuleCmd.class.getName());
 
     private static final String s_name = "createloadbalancerruleresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteApplicationLoadBalancerCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteApplicationLoadBalancerCmd.java
index a723279890a..693b8648b50 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteApplicationLoadBalancerCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteApplicationLoadBalancerCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.loadbalancer;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -36,7 +37,7 @@
 @APICommand(name = "deleteLoadBalancer", description = "Deletes a load balancer", responseObject = SuccessResponse.class, since = "4.2.0",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteApplicationLoadBalancerCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteApplicationLoadBalancerCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteApplicationLoadBalancerCmd.class.getName());
     private static final String s_name = "deleteloadbalancerresponse";
     /////////////////////////////////////////////////////
     //////////////// API parameters /////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteLBHealthCheckPolicyCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteLBHealthCheckPolicyCmd.java
index 74df888b810..8b0679e82c4 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteLBHealthCheckPolicyCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteLBHealthCheckPolicyCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.loadbalancer;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -37,7 +38,7 @@
 @APICommand(name = "deleteLBHealthCheckPolicy", description = "Deletes a load balancer health check policy.", responseObject = SuccessResponse.class, since = "4.2.0",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteLBHealthCheckPolicyCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteLBHealthCheckPolicyCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteLBHealthCheckPolicyCmd.class.getName());
     private static final String s_name = "deletelbhealthcheckpolicyresponse";
     // ///////////////////////////////////////////////////
     // ////////////// API parameters /////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteLBStickinessPolicyCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteLBStickinessPolicyCmd.java
index 10c342911b4..470a960823f 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteLBStickinessPolicyCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteLBStickinessPolicyCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.loadbalancer;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -37,7 +38,7 @@
 @APICommand(name = "deleteLBStickinessPolicy", description = "Deletes a load balancer stickiness policy.", responseObject = SuccessResponse.class, since = "3.0.0",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteLBStickinessPolicyCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteLBStickinessPolicyCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteLBStickinessPolicyCmd.class.getName());
     private static final String s_name = "deleteLBstickinessrruleresponse";
     // ///////////////////////////////////////////////////
     // ////////////// API parameters /////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteLoadBalancerRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteLoadBalancerRuleCmd.java
index 112f6cf7fc8..6bc508b175a 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteLoadBalancerRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteLoadBalancerRuleCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.loadbalancer;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -37,7 +38,7 @@
 @APICommand(name = "deleteLoadBalancerRule", description = "Deletes a load balancer rule.", responseObject = SuccessResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteLoadBalancerRuleCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteLoadBalancerRuleCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteLoadBalancerRuleCmd.class.getName());
     private static final String s_name = "deleteloadbalancerruleresponse";
     /////////////////////////////////////////////////////
     //////////////// API parameters /////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteSslCertCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteSslCertCmd.java
index 656c14c1048..527af9ff576 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteSslCertCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteSslCertCmd.java
@@ -18,7 +18,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -40,7 +41,7 @@
 @APICommand(name = "deleteSslCert", description = "Delete a certificate to CloudStack", responseObject = SuccessResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteSslCertCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteSslCertCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteSslCertCmd.class.getName());
 
     private static final String s_name = "deletesslcertresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListApplicationLoadBalancersCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListApplicationLoadBalancersCmd.java
index 79322c2a6ec..61d9b185984 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListApplicationLoadBalancersCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListApplicationLoadBalancersCmd.java
@@ -29,7 +29,8 @@
 import org.apache.cloudstack.api.response.ListResponse;
 import org.apache.cloudstack.api.response.NetworkResponse;
 import org.apache.cloudstack.network.lb.ApplicationLoadBalancerRule;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.exception.InvalidParameterValueException;
 import com.cloud.network.rules.LoadBalancerContainer.Scheme;
@@ -38,7 +39,7 @@
 @APICommand(name = "listLoadBalancers", description = "Lists load balancers", responseObject = ApplicationLoadBalancerResponse.class, since = "4.2.0",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListApplicationLoadBalancersCmd extends BaseListTaggedResourcesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListApplicationLoadBalancersCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListApplicationLoadBalancersCmd.class.getName());
 
     private static final String s_name = "listloadbalancersresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLBHealthCheckPoliciesCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLBHealthCheckPoliciesCmd.java
index ad0486f31cc..7d36f03e587 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLBHealthCheckPoliciesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLBHealthCheckPoliciesCmd.java
@@ -27,7 +27,8 @@
 import org.apache.cloudstack.api.response.FirewallRuleResponse;
 import org.apache.cloudstack.api.response.LBHealthCheckResponse;
 import org.apache.cloudstack.api.response.ListResponse;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 
 import com.cloud.exception.InvalidParameterValueException;
@@ -37,7 +38,7 @@
 @APICommand(name = "listLBHealthCheckPolicies", description = "Lists load balancer health check policies.", responseObject = LBHealthCheckResponse.class, since = "4.2.0",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListLBHealthCheckPoliciesCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListLBHealthCheckPoliciesCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListLBHealthCheckPoliciesCmd.class.getName());
 
     private static final String s_name = "listlbhealthcheckpoliciesresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLBStickinessPoliciesCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLBStickinessPoliciesCmd.java
index 4e11430d0b4..7b763c88be1 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLBStickinessPoliciesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLBStickinessPoliciesCmd.java
@@ -29,7 +29,8 @@
 import org.apache.cloudstack.api.response.LBStickinessResponse;
 import org.apache.cloudstack.api.response.ListResponse;
 import org.apache.cloudstack.context.CallContext;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.network.rules.LoadBalancer;
 import com.cloud.network.rules.StickinessPolicy;
@@ -38,7 +39,7 @@
 @APICommand(name = "listLBStickinessPolicies", description = "Lists load balancer stickiness policies.", responseObject = LBStickinessResponse.class, since = "3.0.0",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListLBStickinessPoliciesCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListLBStickinessPoliciesCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListLBStickinessPoliciesCmd.class.getName());
 
     private static final String s_name = "listlbstickinesspoliciesresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLoadBalancerRuleInstancesCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLoadBalancerRuleInstancesCmd.java
index e3cde0ba640..8484d83159c 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLoadBalancerRuleInstancesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLoadBalancerRuleInstancesCmd.java
@@ -21,7 +21,8 @@
 
 import com.cloud.vm.VirtualMachine;
 import org.apache.cloudstack.api.response.LoadBalancerRuleVmMapResponse;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -39,7 +40,7 @@
             requestHasSensitiveInfo = false,
             responseHasSensitiveInfo = true)
 public class ListLoadBalancerRuleInstancesCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListLoadBalancerRuleInstancesCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListLoadBalancerRuleInstancesCmd.class.getName());
 
     private static final String s_name = "listloadbalancerruleinstancesresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLoadBalancerRulesCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLoadBalancerRulesCmd.java
index d1fa8da48f4..c8e820aa784 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLoadBalancerRulesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLoadBalancerRulesCmd.java
@@ -31,7 +31,8 @@
 import org.apache.cloudstack.api.response.NetworkResponse;
 import org.apache.cloudstack.api.response.UserVmResponse;
 import org.apache.cloudstack.api.response.ZoneResponse;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.network.rules.LoadBalancer;
 import com.cloud.utils.Pair;
@@ -39,7 +40,7 @@
 @APICommand(name = "listLoadBalancerRules", description = "Lists load balancer rules.", responseObject = LoadBalancerResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListLoadBalancerRulesCmd extends BaseListTaggedResourcesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListLoadBalancerRulesCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListLoadBalancerRulesCmd.class.getName());
 
     private static final String s_name = "listloadbalancerrulesresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListSslCertsCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListSslCertsCmd.java
index cfa56754850..f82404cdb78 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListSslCertsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListSslCertsCmd.java
@@ -20,7 +20,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -39,7 +40,7 @@
 @APICommand(name = "listSslCerts", description = "Lists SSL certificates", responseObject = SslCertResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListSslCertsCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteSslCertCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteSslCertCmd.class.getName());
 
     private static final String s_name = "listsslcertsresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/RemoveCertFromLoadBalancerCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/RemoveCertFromLoadBalancerCmd.java
index d794384b4fa..9f3b75f7760 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/RemoveCertFromLoadBalancerCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/RemoveCertFromLoadBalancerCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.loadbalancer;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -40,7 +41,7 @@
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class RemoveCertFromLoadBalancerCmd extends BaseAsyncCmd {
 
-    public static final Logger s_logger = Logger.getLogger(RemoveCertFromLoadBalancerCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(RemoveCertFromLoadBalancerCmd.class.getName());
 
     private static final String s_name = "removecertfromloadbalancerresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/RemoveFromLoadBalancerRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/RemoveFromLoadBalancerRuleCmd.java
index 13765563fd9..a5b001e0c88 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/RemoveFromLoadBalancerRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/RemoveFromLoadBalancerRuleCmd.java
@@ -24,7 +24,8 @@
 import java.util.ArrayList;
 
 import com.cloud.vm.VirtualMachine;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -49,7 +50,7 @@
             requestHasSensitiveInfo = false,
             responseHasSensitiveInfo = false)
 public class RemoveFromLoadBalancerRuleCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(RemoveFromLoadBalancerRuleCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(RemoveFromLoadBalancerRuleCmd.class.getName());
 
     private static final String s_name = "removefromloadbalancerruleresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/UpdateApplicationLoadBalancerCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/UpdateApplicationLoadBalancerCmd.java
index 3dd15641773..677d82f7f5b 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/UpdateApplicationLoadBalancerCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/UpdateApplicationLoadBalancerCmd.java
@@ -25,7 +25,8 @@
 import org.apache.cloudstack.api.response.FirewallRuleResponse;
 import org.apache.cloudstack.context.CallContext;
 import org.apache.cloudstack.network.lb.ApplicationLoadBalancerRule;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.event.EventTypes;
 import com.cloud.exception.InvalidParameterValueException;
@@ -34,7 +35,7 @@
 @APICommand(name = "updateLoadBalancer", description = "Updates a load balancer", responseObject = ApplicationLoadBalancerResponse.class, since = "4.4.0",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateApplicationLoadBalancerCmd extends BaseAsyncCustomIdCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateApplicationLoadBalancerCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateApplicationLoadBalancerCmd.class.getName());
 
     private static final String s_name = "updateloadbalancerresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/UpdateLBHealthCheckPolicyCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/UpdateLBHealthCheckPolicyCmd.java
index 06d9263c954..38b5fabf9c7 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/UpdateLBHealthCheckPolicyCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/UpdateLBHealthCheckPolicyCmd.java
@@ -19,7 +19,8 @@
 import org.apache.cloudstack.api.Parameter;
 import org.apache.cloudstack.api.response.LBHealthCheckResponse;
 import org.apache.cloudstack.context.CallContext;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.event.EventTypes;
 import com.cloud.network.rules.HealthCheckPolicy;
@@ -30,7 +31,7 @@
 @APICommand(name = "updateLBHealthCheckPolicy", description = "Updates load balancer health check policy", responseObject = LBHealthCheckResponse.class, since = "4.4",
 requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateLBHealthCheckPolicyCmd extends BaseAsyncCustomIdCmd{
-    public static final Logger s_logger = Logger.getLogger(UpdateLBHealthCheckPolicyCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateLBHealthCheckPolicyCmd.class.getName());
 
     private static final String s_name = "updatelbhealthcheckpolicyresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/UpdateLBStickinessPolicyCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/UpdateLBStickinessPolicyCmd.java
index 55b3d578c67..484184555f2 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/UpdateLBStickinessPolicyCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/UpdateLBStickinessPolicyCmd.java
@@ -19,7 +19,8 @@
 import org.apache.cloudstack.api.Parameter;
 import org.apache.cloudstack.api.response.LBStickinessResponse;
 import org.apache.cloudstack.context.CallContext;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.event.EventTypes;
 import com.cloud.network.rules.LoadBalancer;
@@ -29,7 +30,7 @@
 @APICommand(name = "updateLBStickinessPolicy", description = "Updates load balancer stickiness policy", responseObject = LBStickinessResponse.class, since = "4.4",
 requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateLBStickinessPolicyCmd extends BaseAsyncCustomIdCmd{
-    public static final Logger s_logger = Logger.getLogger(UpdateLBStickinessPolicyCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateLBStickinessPolicyCmd.class.getName());
 
     private static final String s_name = "updatelbstickinesspolicyresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/UpdateLoadBalancerRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/UpdateLoadBalancerRuleCmd.java
index 6ee277a354c..a5d06b71409 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/UpdateLoadBalancerRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/UpdateLoadBalancerRuleCmd.java
@@ -27,7 +27,8 @@
 import org.apache.cloudstack.api.response.FirewallRuleResponse;
 import org.apache.cloudstack.api.response.LoadBalancerResponse;
 import org.apache.cloudstack.context.CallContext;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.event.EventTypes;
 import com.cloud.exception.InvalidParameterValueException;
@@ -38,7 +39,7 @@
 @APICommand(name = "updateLoadBalancerRule", description = "Updates load balancer", responseObject = LoadBalancerResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateLoadBalancerRuleCmd extends BaseAsyncCustomIdCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateLoadBalancerRuleCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateLoadBalancerRuleCmd.class.getName());
     private static final String s_name = "updateloadbalancerruleresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/UploadSslCertCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/UploadSslCertCmd.java
index 309e43fcbbe..48b080495bc 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/UploadSslCertCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/UploadSslCertCmd.java
@@ -18,7 +18,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -41,7 +42,7 @@
 @APICommand(name = "uploadSslCert", description = "Upload a certificate to CloudStack", responseObject = SslCertResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UploadSslCertCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(UploadSslCertCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UploadSslCertCmd.class.getName());
 
     private static final String s_name = "uploadsslcertresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/nat/CreateIpForwardingRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/nat/CreateIpForwardingRuleCmd.java
index 1b367a9fa7b..11b9f9ceb4f 100644
--- a/api/src/org/apache/cloudstack/api/command/user/nat/CreateIpForwardingRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/nat/CreateIpForwardingRuleCmd.java
@@ -18,7 +18,8 @@
 
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -45,7 +46,7 @@
 @APICommand(name = "createIpForwardingRule", description = "Creates an IP forwarding rule", responseObject = FirewallRuleResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreateIpForwardingRuleCmd extends BaseAsyncCreateCmd implements StaticNatRule {
-    public static final Logger s_logger = Logger.getLogger(CreateIpForwardingRuleCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateIpForwardingRuleCmd.class.getName());
 
     private static final String s_name = "createipforwardingruleresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/nat/DeleteIpForwardingRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/nat/DeleteIpForwardingRuleCmd.java
index 9059d507319..fcf94aa001f 100644
--- a/api/src/org/apache/cloudstack/api/command/user/nat/DeleteIpForwardingRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/nat/DeleteIpForwardingRuleCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.nat;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -37,7 +38,7 @@
 @APICommand(name = "deleteIpForwardingRule", description = "Deletes an IP forwarding rule", responseObject = SuccessResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteIpForwardingRuleCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteIpForwardingRuleCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteIpForwardingRuleCmd.class.getName());
 
     private static final String s_name = "deleteipforwardingruleresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/nat/DisableStaticNatCmd.java b/api/src/org/apache/cloudstack/api/command/user/nat/DisableStaticNatCmd.java
index 6c59e70443d..ec8d61382a7 100644
--- a/api/src/org/apache/cloudstack/api/command/user/nat/DisableStaticNatCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/nat/DisableStaticNatCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.nat;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -38,7 +39,7 @@
 @APICommand(name = "disableStaticNat", description = "Disables static rule for given IP address", responseObject = SuccessResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DisableStaticNatCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DeletePortForwardingRuleCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeletePortForwardingRuleCmd.class.getName());
     private static final String s_name = "disablestaticnatresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/nat/EnableStaticNatCmd.java b/api/src/org/apache/cloudstack/api/command/user/nat/EnableStaticNatCmd.java
index cddd23d5223..bc3403c11fe 100644
--- a/api/src/org/apache/cloudstack/api/command/user/nat/EnableStaticNatCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/nat/EnableStaticNatCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.nat;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -39,7 +40,7 @@
 @APICommand(name = "enableStaticNat", description = "Enables static NAT for given IP address", responseObject = SuccessResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class EnableStaticNatCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateIpForwardingRuleCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateIpForwardingRuleCmd.class.getName());
 
     private static final String s_name = "enablestaticnatresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/nat/ListIpForwardingRulesCmd.java b/api/src/org/apache/cloudstack/api/command/user/nat/ListIpForwardingRulesCmd.java
index bc157fc9e1f..b00da036be8 100644
--- a/api/src/org/apache/cloudstack/api/command/user/nat/ListIpForwardingRulesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/nat/ListIpForwardingRulesCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -38,7 +39,7 @@
 @APICommand(name = "listIpForwardingRules", description = "List the IP forwarding rules", responseObject = FirewallRuleResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListIpForwardingRulesCmd extends BaseListProjectAndAccountResourcesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListIpForwardingRulesCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListIpForwardingRulesCmd.class.getName());
 
     private static final String s_name = "listipforwardingrulesresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkACLCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkACLCmd.java
index c8a8f8cae39..7e5790587c8 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkACLCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkACLCmd.java
@@ -31,7 +31,8 @@
 import org.apache.cloudstack.api.response.NetworkResponse;
 import org.apache.cloudstack.context.CallContext;
 import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.event.EventTypes;
 import com.cloud.exception.InvalidParameterValueException;
@@ -46,7 +47,7 @@
             requestHasSensitiveInfo = false,
             responseHasSensitiveInfo = false)
 public class CreateNetworkACLCmd extends BaseAsyncCreateCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateNetworkACLCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateNetworkACLCmd.class.getName());
 
     private static final String s_name = "createnetworkaclresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkACLListCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkACLListCmd.java
index 530dc4e7030..a80a0d3eb9e 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkACLListCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkACLListCmd.java
@@ -25,7 +25,8 @@
 import org.apache.cloudstack.api.ServerApiException;
 import org.apache.cloudstack.api.response.NetworkACLResponse;
 import org.apache.cloudstack.api.response.VpcResponse;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.event.EventTypes;
 import com.cloud.exception.InvalidParameterValueException;
@@ -37,7 +38,7 @@
 @APICommand(name = "createNetworkACLList", description = "Creates a network ACL for the given VPC", responseObject = NetworkACLResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreateNetworkACLListCmd extends BaseAsyncCreateCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateNetworkACLListCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateNetworkACLListCmd.class.getName());
 
     private static final String s_name = "createnetworkacllistresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkCmd.java
index 17312614808..91e6ae68340 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkCmd.java
@@ -17,7 +17,8 @@
 package org.apache.cloudstack.api.command.user.network;
 
 import com.cloud.utils.net.NetUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.api.APICommand;
@@ -48,7 +49,7 @@
 @APICommand(name = "createNetwork", description = "Creates a network", responseObject = NetworkResponse.class, responseView = ResponseView.Restricted, entityType = {Network.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreateNetworkCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateNetworkCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateNetworkCmd.class.getName());
 
     private static final String s_name = "createnetworkresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/DeleteNetworkACLCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/DeleteNetworkACLCmd.java
index ab6df801fe9..8d62a8a0be1 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/DeleteNetworkACLCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/DeleteNetworkACLCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.network;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -35,7 +36,7 @@
 @APICommand(name = "deleteNetworkACL", description = "Deletes a network ACL", responseObject = SuccessResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteNetworkACLCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteNetworkACLCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteNetworkACLCmd.class.getName());
     private static final String s_name = "deletenetworkaclresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/DeleteNetworkACLListCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/DeleteNetworkACLListCmd.java
index 19cf601d63a..756fa7752fa 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/DeleteNetworkACLListCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/DeleteNetworkACLListCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.network;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -35,7 +36,7 @@
 @APICommand(name = "deleteNetworkACLList", description = "Deletes a network ACL", responseObject = SuccessResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteNetworkACLListCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteNetworkACLListCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteNetworkACLListCmd.class.getName());
     private static final String s_name = "deletenetworkacllistresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/DeleteNetworkCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/DeleteNetworkCmd.java
index 43b6633bde4..1d9cea7ba40 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/DeleteNetworkCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/DeleteNetworkCmd.java
@@ -17,7 +17,8 @@
 package org.apache.cloudstack.api.command.user.network;
 
 import org.apache.cloudstack.api.ApiCommandJobType;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -39,7 +40,7 @@
 @APICommand(name = "deleteNetwork", description = "Deletes a network", responseObject = SuccessResponse.class, entityType = {Network.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteNetworkCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteNetworkOfferingCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteNetworkOfferingCmd.class.getName());
     private static final String s_name = "deletenetworkresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/ListNetworkACLListsCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/ListNetworkACLListsCmd.java
index 80d616ab6fc..90d368e31fc 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/ListNetworkACLListsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/ListNetworkACLListsCmd.java
@@ -28,7 +28,8 @@
 import org.apache.cloudstack.api.response.NetworkACLResponse;
 import org.apache.cloudstack.api.response.NetworkResponse;
 import org.apache.cloudstack.api.response.VpcResponse;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.network.vpc.NetworkACL;
 import com.cloud.utils.Pair;
@@ -36,7 +37,7 @@
 @APICommand(name = "listNetworkACLLists", description = "Lists all network ACLs", responseObject = NetworkACLResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListNetworkACLListsCmd extends BaseListProjectAndAccountResourcesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListNetworkACLListsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListNetworkACLListsCmd.class.getName());
 
     private static final String s_name = "listnetworkacllistsresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/ListNetworkACLsCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/ListNetworkACLsCmd.java
index 4815bf400e4..641cb8bca8c 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/ListNetworkACLsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/ListNetworkACLsCmd.java
@@ -28,7 +28,8 @@
 import org.apache.cloudstack.api.response.NetworkACLItemResponse;
 import org.apache.cloudstack.api.response.NetworkACLResponse;
 import org.apache.cloudstack.api.response.NetworkResponse;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.network.vpc.NetworkACLItem;
 import com.cloud.utils.Pair;
@@ -36,7 +37,7 @@
 @APICommand(name = "listNetworkACLs", description = "Lists all network ACL items", responseObject = NetworkACLItemResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListNetworkACLsCmd extends BaseListTaggedResourcesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListNetworkACLsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListNetworkACLsCmd.class.getName());
 
     private static final String s_name = "listnetworkaclsresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/ListNetworkOfferingsCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/ListNetworkOfferingsCmd.java
index 0c57bf96c8f..65cfa2f6c79 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/ListNetworkOfferingsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/ListNetworkOfferingsCmd.java
@@ -27,7 +27,8 @@
 import org.apache.cloudstack.api.response.NetworkOfferingResponse;
 import org.apache.cloudstack.api.response.NetworkResponse;
 import org.apache.cloudstack.api.response.ZoneResponse;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.offering.NetworkOffering;
 import com.cloud.utils.Pair;
@@ -35,7 +36,7 @@
 @APICommand(name = "listNetworkOfferings", description = "Lists all available network offerings.", responseObject = NetworkOfferingResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListNetworkOfferingsCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListNetworkOfferingsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListNetworkOfferingsCmd.class.getName());
     private static final String s_name = "listnetworkofferingsresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/ListNetworksCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/ListNetworksCmd.java
index 041d6417044..78df1ddd02c 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/ListNetworksCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/ListNetworksCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.api.APICommand;
@@ -39,7 +40,7 @@
 @APICommand(name = "listNetworks", description = "Lists all available networks.", responseObject = NetworkResponse.class, responseView = ResponseView.Restricted, entityType = {Network.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListNetworksCmd extends BaseListTaggedResourcesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListNetworksCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListNetworksCmd.class.getName());
     private static final String s_name = "listnetworksresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/ReplaceNetworkACLListCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/ReplaceNetworkACLListCmd.java
index fc08753a679..30a33e8af9c 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/ReplaceNetworkACLListCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/ReplaceNetworkACLListCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.network;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -37,7 +38,7 @@
 @APICommand(name = "replaceNetworkACLList", description = "Replaces ACL associated with a network or private gateway", responseObject = SuccessResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ReplaceNetworkACLListCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(ReplaceNetworkACLListCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ReplaceNetworkACLListCmd.class.getName());
     private static final String s_name = "replacenetworkacllistresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/RestartNetworkCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/RestartNetworkCmd.java
index 62566653bca..9001b48cb24 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/RestartNetworkCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/RestartNetworkCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.network;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -44,7 +45,7 @@
             requestHasSensitiveInfo = false,
             responseHasSensitiveInfo = false)
 public class RestartNetworkCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(RestartNetworkCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(RestartNetworkCmd.class.getName());
     private static final String s_name = "restartnetworkresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkACLItemCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkACLItemCmd.java
index acc2ae86420..88c0398cd3b 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkACLItemCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkACLItemCmd.java
@@ -27,7 +27,8 @@
 import org.apache.cloudstack.api.ServerApiException;
 import org.apache.cloudstack.api.response.NetworkACLItemResponse;
 import org.apache.cloudstack.context.CallContext;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.event.EventTypes;
 import com.cloud.exception.ResourceUnavailableException;
@@ -37,7 +38,7 @@
 @APICommand(name = "updateNetworkACLItem", description = "Updates ACL item with specified ID", responseObject = NetworkACLItemResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateNetworkACLItemCmd extends BaseAsyncCustomIdCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateNetworkACLItemCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateNetworkACLItemCmd.class.getName());
 
     private static final String s_name = "createnetworkaclresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkACLListCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkACLListCmd.java
index aa1f557e72b..5fa51d0c8b1 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkACLListCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkACLListCmd.java
@@ -24,7 +24,8 @@
 import org.apache.cloudstack.api.response.NetworkACLResponse;
 import org.apache.cloudstack.api.response.SuccessResponse;
 import org.apache.cloudstack.context.CallContext;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.event.EventTypes;
 import com.cloud.exception.ResourceUnavailableException;
@@ -34,7 +35,7 @@
 @APICommand(name = "updateNetworkACLList", description = "Updates network ACL list", responseObject = SuccessResponse.class, since = "4.4",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateNetworkACLListCmd extends BaseAsyncCustomIdCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateNetworkACLListCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateNetworkACLListCmd.class.getName());
     private static final String s_name = "updatenetworkacllistresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkCmd.java
index c313f369b0e..267d538e06f 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.network;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
@@ -45,7 +46,7 @@
 @APICommand(name = "updateNetwork", description = "Updates a network", responseObject = NetworkResponse.class, responseView = ResponseView.Restricted, entityType = {Network.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateNetworkCmd extends BaseAsyncCustomIdCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateNetworkCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateNetworkCmd.class.getName());
 
     private static final String s_name = "updatenetworkresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/offering/ListDiskOfferingsCmd.java b/api/src/org/apache/cloudstack/api/command/user/offering/ListDiskOfferingsCmd.java
index e5f92c9e0de..59373c341e0 100644
--- a/api/src/org/apache/cloudstack/api/command/user/offering/ListDiskOfferingsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/offering/ListDiskOfferingsCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.offering;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -28,7 +29,7 @@
 @APICommand(name = "listDiskOfferings", description = "Lists all available disk offerings.", responseObject = DiskOfferingResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListDiskOfferingsCmd extends BaseListDomainResourcesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListDiskOfferingsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListDiskOfferingsCmd.class.getName());
 
     private static final String s_name = "listdiskofferingsresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/offering/ListServiceOfferingsCmd.java b/api/src/org/apache/cloudstack/api/command/user/offering/ListServiceOfferingsCmd.java
index 4b7481974f2..74b598b6856 100644
--- a/api/src/org/apache/cloudstack/api/command/user/offering/ListServiceOfferingsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/offering/ListServiceOfferingsCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.offering;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -29,7 +30,7 @@
 @APICommand(name = "listServiceOfferings", description = "Lists all available service offerings.", responseObject = ServiceOfferingResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListServiceOfferingsCmd extends BaseListDomainResourcesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListServiceOfferingsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListServiceOfferingsCmd.class.getName());
 
     private static final String s_name = "listserviceofferingsresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/project/ActivateProjectCmd.java b/api/src/org/apache/cloudstack/api/command/user/project/ActivateProjectCmd.java
index 5b1b76e95ea..adde458007a 100644
--- a/api/src/org/apache/cloudstack/api/command/user/project/ActivateProjectCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/project/ActivateProjectCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.project;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -34,7 +35,7 @@
 @APICommand(name = "activateProject", description = "Activates a project", responseObject = ProjectResponse.class, since = "3.0.0",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ActivateProjectCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(ActivateProjectCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ActivateProjectCmd.class.getName());
 
     private static final String s_name = "activaterojectresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/project/CreateProjectCmd.java b/api/src/org/apache/cloudstack/api/command/user/project/CreateProjectCmd.java
index e8a045ca1cc..30b9d92040b 100644
--- a/api/src/org/apache/cloudstack/api/command/user/project/CreateProjectCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/project/CreateProjectCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.project;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -37,7 +38,7 @@
 @APICommand(name = "createProject", description = "Creates a project", responseObject = ProjectResponse.class, since = "3.0.0",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreateProjectCmd extends BaseAsyncCreateCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateProjectCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateProjectCmd.class.getName());
 
     private static final String s_name = "createprojectresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/project/DeleteProjectCmd.java b/api/src/org/apache/cloudstack/api/command/user/project/DeleteProjectCmd.java
index 3a2e48d51ab..df7ad747dde 100644
--- a/api/src/org/apache/cloudstack/api/command/user/project/DeleteProjectCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/project/DeleteProjectCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.project;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -35,7 +36,7 @@
 @APICommand(name = "deleteProject", description = "Deletes a project", responseObject = SuccessResponse.class, since = "3.0.0",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteProjectCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteProjectCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteProjectCmd.class.getName());
 
     private static final String s_name = "deleteprojectresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/project/DeleteProjectInvitationCmd.java b/api/src/org/apache/cloudstack/api/command/user/project/DeleteProjectInvitationCmd.java
index 736a800888f..60b5c7e2940 100644
--- a/api/src/org/apache/cloudstack/api/command/user/project/DeleteProjectInvitationCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/project/DeleteProjectInvitationCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.project;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -34,7 +35,7 @@
 @APICommand(name = "deleteProjectInvitation", description = "Deletes project invitation", responseObject = SuccessResponse.class, since = "3.0.0",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteProjectInvitationCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteProjectInvitationCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteProjectInvitationCmd.class.getName());
     private static final String s_name = "deleteprojectinvitationresponse";
 
     // ///////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/project/ListProjectInvitationsCmd.java b/api/src/org/apache/cloudstack/api/command/user/project/ListProjectInvitationsCmd.java
index f34f4226b0e..d9f8d7895e8 100644
--- a/api/src/org/apache/cloudstack/api/command/user/project/ListProjectInvitationsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/project/ListProjectInvitationsCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.project;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -33,7 +34,7 @@
             requestHasSensitiveInfo = false,
             responseHasSensitiveInfo = false)
 public class ListProjectInvitationsCmd extends BaseListAccountResourcesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListProjectInvitationsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListProjectInvitationsCmd.class.getName());
     private static final String s_name = "listprojectinvitationsresponse";
 
     // ///////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/project/ListProjectsCmd.java b/api/src/org/apache/cloudstack/api/command/user/project/ListProjectsCmd.java
index 7b479b1a9ff..523e50a193c 100644
--- a/api/src/org/apache/cloudstack/api/command/user/project/ListProjectsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/project/ListProjectsCmd.java
@@ -21,7 +21,8 @@
 import java.util.Iterator;
 import java.util.Map;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -39,7 +40,7 @@
             requestHasSensitiveInfo = false,
             responseHasSensitiveInfo = false)
 public class ListProjectsCmd extends BaseListAccountResourcesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListProjectsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListProjectsCmd.class.getName());
     private static final String s_name = "listprojectsresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/project/SuspendProjectCmd.java b/api/src/org/apache/cloudstack/api/command/user/project/SuspendProjectCmd.java
index 69a4b77c7a5..60c09679678 100644
--- a/api/src/org/apache/cloudstack/api/command/user/project/SuspendProjectCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/project/SuspendProjectCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.project;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -36,7 +37,7 @@
 @APICommand(name = "suspendProject", description = "Suspends a project", responseObject = ProjectResponse.class, since = "3.0.0",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class SuspendProjectCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(SuspendProjectCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(SuspendProjectCmd.class.getName());
 
     private static final String s_name = "suspendprojectresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/project/UpdateProjectCmd.java b/api/src/org/apache/cloudstack/api/command/user/project/UpdateProjectCmd.java
index 11e5e35bac3..6757bdb68fc 100644
--- a/api/src/org/apache/cloudstack/api/command/user/project/UpdateProjectCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/project/UpdateProjectCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.project;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -35,7 +36,7 @@
 @APICommand(name = "updateProject", description = "Updates a project", responseObject = ProjectResponse.class, since = "3.0.0",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateProjectCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateProjectCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateProjectCmd.class.getName());
 
     private static final String s_name = "updateprojectresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/project/UpdateProjectInvitationCmd.java b/api/src/org/apache/cloudstack/api/command/user/project/UpdateProjectInvitationCmd.java
index 79e3f8a9cfd..fa852fb381e 100644
--- a/api/src/org/apache/cloudstack/api/command/user/project/UpdateProjectInvitationCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/project/UpdateProjectInvitationCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.project;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -34,7 +35,7 @@
 @APICommand(name = "updateProjectInvitation", description = "Accepts or declines project invitation", responseObject = SuccessResponse.class, since = "3.0.0",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateProjectInvitationCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateProjectInvitationCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateProjectInvitationCmd.class.getName());
     private static final String s_name = "updateprojectinvitationresponse";
 
     // ///////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/region/ListRegionsCmd.java b/api/src/org/apache/cloudstack/api/command/user/region/ListRegionsCmd.java
index 9a0b186d9ea..e0bd5477d5a 100644
--- a/api/src/org/apache/cloudstack/api/command/user/region/ListRegionsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/region/ListRegionsCmd.java
@@ -21,7 +21,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -35,7 +36,7 @@
 @APICommand(name = "listRegions", description = "Lists Regions", responseObject = RegionResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListRegionsCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListRegionsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListRegionsCmd.class.getName());
 
     private static final String s_name = "listregionsresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/AssignToGlobalLoadBalancerRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/AssignToGlobalLoadBalancerRuleCmd.java
index 99971bf67d1..ee22790e8f1 100644
--- a/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/AssignToGlobalLoadBalancerRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/AssignToGlobalLoadBalancerRuleCmd.java
@@ -25,7 +25,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -53,7 +54,7 @@
             responseHasSensitiveInfo = false)
 public class AssignToGlobalLoadBalancerRuleCmd extends BaseAsyncCmd {
 
-    public static final Logger s_logger = Logger.getLogger(AssignToGlobalLoadBalancerRuleCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(AssignToGlobalLoadBalancerRuleCmd.class.getName());
 
     private static final String s_name = "assigntogloballoadbalancerruleresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/CreateGlobalLoadBalancerRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/CreateGlobalLoadBalancerRuleCmd.java
index 18f5b7683cf..be696492b59 100644
--- a/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/CreateGlobalLoadBalancerRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/CreateGlobalLoadBalancerRuleCmd.java
@@ -30,7 +30,8 @@
 import org.apache.cloudstack.api.response.GlobalLoadBalancerResponse;
 import org.apache.cloudstack.api.response.RegionResponse;
 import org.apache.cloudstack.context.CallContext;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.event.EventTypes;
 import com.cloud.exception.ResourceAllocationException;
@@ -42,7 +43,7 @@
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreateGlobalLoadBalancerRuleCmd extends BaseAsyncCreateCmd {
 
-    public static final Logger s_logger = Logger.getLogger(CreateGlobalLoadBalancerRuleCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateGlobalLoadBalancerRuleCmd.class.getName());
 
     private static final String s_name = "creategloballoadbalancerruleresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/DeleteGlobalLoadBalancerRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/DeleteGlobalLoadBalancerRuleCmd.java
index dfb093d5b16..061eecb8425 100644
--- a/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/DeleteGlobalLoadBalancerRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/DeleteGlobalLoadBalancerRuleCmd.java
@@ -19,7 +19,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -41,7 +42,7 @@
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteGlobalLoadBalancerRuleCmd extends BaseAsyncCmd {
 
-    public static final Logger s_logger = Logger.getLogger(DeleteGlobalLoadBalancerRuleCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteGlobalLoadBalancerRuleCmd.class.getName());
 
     private static final String s_name = "deletegloballoadbalancerruleresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/ListGlobalLoadBalancerRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/ListGlobalLoadBalancerRuleCmd.java
index e5630f87e14..93cd38f35ef 100644
--- a/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/ListGlobalLoadBalancerRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/ListGlobalLoadBalancerRuleCmd.java
@@ -22,7 +22,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -38,7 +39,7 @@
 @APICommand(name = "listGlobalLoadBalancerRules", description = "Lists load balancer rules.", responseObject = GlobalLoadBalancerResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListGlobalLoadBalancerRuleCmd extends BaseListTaggedResourcesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListGlobalLoadBalancerRuleCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListGlobalLoadBalancerRuleCmd.class.getName());
 
     private static final String s_name = "listgloballoadbalancerrulesresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/RemoveFromGlobalLoadBalancerRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/RemoveFromGlobalLoadBalancerRuleCmd.java
index c514984d217..3fe196af3c5 100644
--- a/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/RemoveFromGlobalLoadBalancerRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/RemoveFromGlobalLoadBalancerRuleCmd.java
@@ -21,7 +21,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -47,7 +48,7 @@
             requestHasSensitiveInfo = false,
             responseHasSensitiveInfo = false)
 public class RemoveFromGlobalLoadBalancerRuleCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(RemoveFromGlobalLoadBalancerRuleCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(RemoveFromGlobalLoadBalancerRuleCmd.class.getName());
 
     private static final String s_name = "removefromloadbalancerruleresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/UpdateGlobalLoadBalancerRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/UpdateGlobalLoadBalancerRuleCmd.java
index 6c75400c2df..098b0624630 100644
--- a/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/UpdateGlobalLoadBalancerRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/UpdateGlobalLoadBalancerRuleCmd.java
@@ -19,7 +19,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -37,7 +38,7 @@
 @APICommand(name = "updateGlobalLoadBalancerRule", description = "update global load balancer rules.", responseObject = GlobalLoadBalancerResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateGlobalLoadBalancerRuleCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(GlobalLoadBalancerResponse.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(GlobalLoadBalancerResponse.class.getName());
 
     private static final String s_name = "updategloballoadbalancerruleresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/resource/GetCloudIdentifierCmd.java b/api/src/org/apache/cloudstack/api/command/user/resource/GetCloudIdentifierCmd.java
index 366401f3a6f..ec06f16bcac 100644
--- a/api/src/org/apache/cloudstack/api/command/user/resource/GetCloudIdentifierCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/resource/GetCloudIdentifierCmd.java
@@ -18,7 +18,8 @@
 
 import java.util.ArrayList;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -34,7 +35,7 @@
 @APICommand(name = "getCloudIdentifier", description = "Retrieves a cloud identifier.", responseObject = CloudIdentifierResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class GetCloudIdentifierCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(GetCloudIdentifierCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(GetCloudIdentifierCmd.class.getName());
     private static final String s_name = "getcloudidentifierresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/resource/ListHypervisorsCmd.java b/api/src/org/apache/cloudstack/api/command/user/resource/ListHypervisorsCmd.java
index edaa4051c76..d1dab554564 100644
--- a/api/src/org/apache/cloudstack/api/command/user/resource/ListHypervisorsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/resource/ListHypervisorsCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -35,7 +36,7 @@
 @APICommand(name = "listHypervisors", description = "List hypervisors", responseObject = HypervisorResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListHypervisorsCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(UpgradeRouterCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpgradeRouterCmd.class.getName());
     private static final String s_name = "listhypervisorsresponse";
 
     @Override
diff --git a/api/src/org/apache/cloudstack/api/command/user/resource/ListResourceLimitsCmd.java b/api/src/org/apache/cloudstack/api/command/user/resource/ListResourceLimitsCmd.java
index 14d1d55ff8b..bd91f08ea17 100644
--- a/api/src/org/apache/cloudstack/api/command/user/resource/ListResourceLimitsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/resource/ListResourceLimitsCmd.java
@@ -25,14 +25,15 @@
 import org.apache.cloudstack.api.Parameter;
 import org.apache.cloudstack.api.response.ListResponse;
 import org.apache.cloudstack.api.response.ResourceLimitResponse;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.configuration.ResourceLimit;
 
 @APICommand(name = "listResourceLimits", description = "Lists resource limits.", responseObject = ResourceLimitResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListResourceLimitsCmd extends BaseListProjectAndAccountResourcesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListResourceLimitsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListResourceLimitsCmd.class.getName());
 
     private static final String s_name = "listresourcelimitsresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java b/api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java
index 0591a8439df..3710c852908 100644
--- a/api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java
@@ -30,7 +30,8 @@
 import org.apache.cloudstack.api.response.ProjectResponse;
 import org.apache.cloudstack.api.response.ResourceCountResponse;
 import org.apache.cloudstack.context.CallContext;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.configuration.ResourceCount;
 import com.cloud.user.Account;
@@ -38,7 +39,7 @@
 @APICommand(name = "updateResourceCount", description = "Recalculate and update resource count for an account or domain.", responseObject = ResourceCountResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateResourceCountCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateResourceCountCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateResourceCountCmd.class.getName());
 
     private static final String s_name = "updateresourcecountresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java b/api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java
index b88ab383f2c..2b2d090c2b0 100644
--- a/api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java
@@ -26,14 +26,15 @@
 import org.apache.cloudstack.api.response.ProjectResponse;
 import org.apache.cloudstack.api.response.ResourceLimitResponse;
 import org.apache.cloudstack.context.CallContext;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.configuration.ResourceLimit;
 
 @APICommand(name = "updateResourceLimit", description = "Updates resource limits for an account or domain.", responseObject = ResourceLimitResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateResourceLimitCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateResourceLimitCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateResourceLimitCmd.class.getName());
 
     private static final String s_name = "updateresourcelimitresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/securitygroup/AuthorizeSecurityGroupEgressCmd.java b/api/src/org/apache/cloudstack/api/command/user/securitygroup/AuthorizeSecurityGroupEgressCmd.java
index f7339e997d6..e12d0d11560 100644
--- a/api/src/org/apache/cloudstack/api/command/user/securitygroup/AuthorizeSecurityGroupEgressCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/securitygroup/AuthorizeSecurityGroupEgressCmd.java
@@ -22,7 +22,8 @@
 import java.util.List;
 import java.util.Map;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -50,7 +51,7 @@
             responseHasSensitiveInfo = false)
 @SuppressWarnings("rawtypes")
 public class AuthorizeSecurityGroupEgressCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(AuthorizeSecurityGroupIngressCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(AuthorizeSecurityGroupIngressCmd.class.getName());
 
     private static final String s_name = "authorizesecuritygroupegressresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/securitygroup/AuthorizeSecurityGroupIngressCmd.java b/api/src/org/apache/cloudstack/api/command/user/securitygroup/AuthorizeSecurityGroupIngressCmd.java
index a8073862933..afbabdb6569 100644
--- a/api/src/org/apache/cloudstack/api/command/user/securitygroup/AuthorizeSecurityGroupIngressCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/securitygroup/AuthorizeSecurityGroupIngressCmd.java
@@ -22,7 +22,8 @@
 import java.util.List;
 import java.util.Map;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -50,7 +51,7 @@
             responseHasSensitiveInfo = false)
 @SuppressWarnings("rawtypes")
 public class AuthorizeSecurityGroupIngressCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(AuthorizeSecurityGroupIngressCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(AuthorizeSecurityGroupIngressCmd.class.getName());
 
     private static final String s_name = "authorizesecuritygroupingressresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/securitygroup/CreateSecurityGroupCmd.java b/api/src/org/apache/cloudstack/api/command/user/securitygroup/CreateSecurityGroupCmd.java
index d3d35bc0b33..ff73253e47b 100644
--- a/api/src/org/apache/cloudstack/api/command/user/securitygroup/CreateSecurityGroupCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/securitygroup/CreateSecurityGroupCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.securitygroup;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -35,7 +36,7 @@
 @APICommand(name = "createSecurityGroup", responseObject = SecurityGroupResponse.class, description = "Creates a security group", entityType = {SecurityGroup.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreateSecurityGroupCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateSecurityGroupCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateSecurityGroupCmd.class.getName());
 
     private static final String s_name = "createsecuritygroupresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/securitygroup/DeleteSecurityGroupCmd.java b/api/src/org/apache/cloudstack/api/command/user/securitygroup/DeleteSecurityGroupCmd.java
index 87e6df41b6b..2ef343c1b2b 100644
--- a/api/src/org/apache/cloudstack/api/command/user/securitygroup/DeleteSecurityGroupCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/securitygroup/DeleteSecurityGroupCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.securitygroup;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -39,7 +40,7 @@
 @APICommand(name = "deleteSecurityGroup", description = "Deletes security group", responseObject = SuccessResponse.class, entityType = {SecurityGroup.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteSecurityGroupCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteSecurityGroupCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteSecurityGroupCmd.class.getName());
     private static final String s_name = "deletesecuritygroupresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/securitygroup/ListSecurityGroupsCmd.java b/api/src/org/apache/cloudstack/api/command/user/securitygroup/ListSecurityGroupsCmd.java
index 4a8081a3507..e61f4eaa588 100644
--- a/api/src/org/apache/cloudstack/api/command/user/securitygroup/ListSecurityGroupsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/securitygroup/ListSecurityGroupsCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.securitygroup;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -32,7 +33,7 @@
 @APICommand(name = "listSecurityGroups", description = "Lists security groups", responseObject = SecurityGroupResponse.class, entityType = {SecurityGroup.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListSecurityGroupsCmd extends BaseListTaggedResourcesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListSecurityGroupsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListSecurityGroupsCmd.class.getName());
 
     private static final String s_name = "listsecuritygroupsresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/securitygroup/RevokeSecurityGroupEgressCmd.java b/api/src/org/apache/cloudstack/api/command/user/securitygroup/RevokeSecurityGroupEgressCmd.java
index a28a220b534..ef4cbda7d68 100644
--- a/api/src/org/apache/cloudstack/api/command/user/securitygroup/RevokeSecurityGroupEgressCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/securitygroup/RevokeSecurityGroupEgressCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.securitygroup;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -38,7 +39,7 @@
             requestHasSensitiveInfo = false,
             responseHasSensitiveInfo = false)
 public class RevokeSecurityGroupEgressCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(RevokeSecurityGroupEgressCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(RevokeSecurityGroupEgressCmd.class.getName());
 
     private static final String s_name = "revokesecuritygroupegressresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/securitygroup/RevokeSecurityGroupIngressCmd.java b/api/src/org/apache/cloudstack/api/command/user/securitygroup/RevokeSecurityGroupIngressCmd.java
index 9e81d0bc4ee..cc03d53b8c5 100644
--- a/api/src/org/apache/cloudstack/api/command/user/securitygroup/RevokeSecurityGroupIngressCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/securitygroup/RevokeSecurityGroupIngressCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.securitygroup;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -38,7 +39,7 @@
 @APICommand(name = "revokeSecurityGroupIngress", responseObject = SuccessResponse.class, description = "Deletes a particular ingress rule from this security group", entityType = {SecurityGroup.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class RevokeSecurityGroupIngressCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(RevokeSecurityGroupIngressCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(RevokeSecurityGroupIngressCmd.class.getName());
 
     private static final String s_name = "revokesecuritygroupingressresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java b/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java
index d66b6499399..14c7b263a8f 100644
--- a/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java
@@ -37,12 +37,13 @@
 import org.apache.cloudstack.api.response.SnapshotPolicyResponse;
 import org.apache.cloudstack.api.response.SnapshotResponse;
 import org.apache.cloudstack.api.response.VolumeResponse;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 @APICommand(name = "createSnapshot", description = "Creates an instant snapshot of a volume.", responseObject = SnapshotResponse.class, entityType = {Snapshot.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreateSnapshotCmd extends BaseAsyncCreateCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateSnapshotCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateSnapshotCmd.class.getName());
     private static final String s_name = "createsnapshotresponse";
 
     // ///////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotFromVMSnapshotCmd.java b/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotFromVMSnapshotCmd.java
index 7a35d3462f5..27934f8001b 100644
--- a/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotFromVMSnapshotCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotFromVMSnapshotCmd.java
@@ -28,7 +28,8 @@
 import org.apache.cloudstack.api.response.VMSnapshotResponse;
 import org.apache.cloudstack.api.response.VolumeResponse;
 import org.apache.cloudstack.context.CallContext;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.event.EventTypes;
 import com.cloud.exception.InvalidParameterValueException;
@@ -43,7 +44,7 @@
 @APICommand(name = "createSnapshotFromVMSnapshot", description = "Creates an instant snapshot of a volume from existing vm snapshot.", responseObject = SnapshotResponse.class, entityType = {Snapshot.class}, since = "4.10.0",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreateSnapshotFromVMSnapshotCmd extends BaseAsyncCreateCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateSnapshotFromVMSnapshotCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateSnapshotFromVMSnapshotCmd.class.getName());
     private static final String s_name = "createsnapshotfromvmsnapshotresponse";
 
     // ///////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotPolicyCmd.java b/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotPolicyCmd.java
index 4e2e6bd3bbd..6d87ad2c163 100644
--- a/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotPolicyCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotPolicyCmd.java
@@ -17,7 +17,8 @@
 package org.apache.cloudstack.api.command.user.snapshot;
 
 import org.apache.cloudstack.acl.RoleType;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -38,7 +39,7 @@
 @APICommand(name = "createSnapshotPolicy", description = "Creates a snapshot policy for the account.", responseObject = SnapshotPolicyResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreateSnapshotPolicyCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateSnapshotPolicyCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateSnapshotPolicyCmd.class.getName());
 
     private static final String s_name = "createsnapshotpolicyresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/snapshot/DeleteSnapshotCmd.java b/api/src/org/apache/cloudstack/api/command/user/snapshot/DeleteSnapshotCmd.java
index 64a432d0bcb..fc68f6f5c67 100644
--- a/api/src/org/apache/cloudstack/api/command/user/snapshot/DeleteSnapshotCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/snapshot/DeleteSnapshotCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.snapshot;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -38,7 +39,7 @@
 @APICommand(name = "deleteSnapshot", description = "Deletes a snapshot of a disk volume.", responseObject = SuccessResponse.class, entityType = {Snapshot.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteSnapshotCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteSnapshotCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteSnapshotCmd.class.getName());
     private static final String s_name = "deletesnapshotresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/snapshot/DeleteSnapshotPoliciesCmd.java b/api/src/org/apache/cloudstack/api/command/user/snapshot/DeleteSnapshotPoliciesCmd.java
index 2d97d3df261..6ccc25a3e0d 100644
--- a/api/src/org/apache/cloudstack/api/command/user/snapshot/DeleteSnapshotPoliciesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/snapshot/DeleteSnapshotPoliciesCmd.java
@@ -18,7 +18,8 @@
 
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -34,7 +35,7 @@
 @APICommand(name = "deleteSnapshotPolicies", description = "Deletes snapshot policies for the account.", responseObject = SuccessResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteSnapshotPoliciesCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteSnapshotPoliciesCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteSnapshotPoliciesCmd.class.getName());
 
     private static final String s_name = "deletesnapshotpoliciesresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/snapshot/ListSnapshotPoliciesCmd.java b/api/src/org/apache/cloudstack/api/command/user/snapshot/ListSnapshotPoliciesCmd.java
index 282f82c36d7..2e040d9d427 100644
--- a/api/src/org/apache/cloudstack/api/command/user/snapshot/ListSnapshotPoliciesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/snapshot/ListSnapshotPoliciesCmd.java
@@ -20,7 +20,8 @@
 import java.util.List;
 
 import org.apache.cloudstack.acl.RoleType;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -36,7 +37,7 @@
 @APICommand(name = "listSnapshotPolicies", description = "Lists snapshot policies.", responseObject = SnapshotPolicyResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListSnapshotPoliciesCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListSnapshotPoliciesCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListSnapshotPoliciesCmd.class.getName());
 
     private static final String s_name = "listsnapshotpoliciesresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/snapshot/ListSnapshotsCmd.java b/api/src/org/apache/cloudstack/api/command/user/snapshot/ListSnapshotsCmd.java
index bdb23e4ad5b..7c1d84592d9 100644
--- a/api/src/org/apache/cloudstack/api/command/user/snapshot/ListSnapshotsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/snapshot/ListSnapshotsCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -37,7 +38,7 @@
 @APICommand(name = "listSnapshots", description = "Lists all available snapshots for the account.", responseObject = SnapshotResponse.class, entityType = {
         Snapshot.class }, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListSnapshotsCmd extends BaseListTaggedResourcesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListSnapshotsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListSnapshotsCmd.class.getName());
 
     private static final String s_name = "listsnapshotsresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/snapshot/RevertSnapshotCmd.java b/api/src/org/apache/cloudstack/api/command/user/snapshot/RevertSnapshotCmd.java
index 4708aff6ff4..b2570dc125f 100644
--- a/api/src/org/apache/cloudstack/api/command/user/snapshot/RevertSnapshotCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/snapshot/RevertSnapshotCmd.java
@@ -30,7 +30,8 @@
 import org.apache.cloudstack.api.ServerApiException;
 import org.apache.cloudstack.api.response.SnapshotResponse;
 import org.apache.cloudstack.context.CallContext;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.event.EventTypes;
 import com.cloud.storage.Snapshot;
@@ -39,7 +40,7 @@
 @APICommand(name = "revertSnapshot", description = "This is supposed to revert a volume snapshot. This command is only supported with KVM so far", responseObject = SnapshotResponse.class, entityType = {Snapshot.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class RevertSnapshotCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(RevertSnapshotCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(RevertSnapshotCmd.class.getName());
     private static final String s_name = "revertsnapshotresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/snapshot/UpdateSnapshotPolicyCmd.java b/api/src/org/apache/cloudstack/api/command/user/snapshot/UpdateSnapshotPolicyCmd.java
index 7181fd50d08..2362d13873d 100644
--- a/api/src/org/apache/cloudstack/api/command/user/snapshot/UpdateSnapshotPolicyCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/snapshot/UpdateSnapshotPolicyCmd.java
@@ -33,13 +33,14 @@
 import org.apache.cloudstack.api.ServerApiException;
 import org.apache.cloudstack.api.response.SnapshotPolicyResponse;
 import org.apache.cloudstack.context.CallContext;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 
 @APICommand(name = "updateSnapshotPolicy", description = "Updates the snapshot policy.", responseObject = SnapshotPolicyResponse.class, responseView = ResponseObject.ResponseView.Restricted, entityType = {Volume.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateSnapshotPolicyCmd extends BaseAsyncCustomIdCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateSnapshotPolicyCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateSnapshotPolicyCmd.class.getName());
     private static final String s_name = "updatesnapshotpolicyresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/ssh/CreateSSHKeyPairCmd.java b/api/src/org/apache/cloudstack/api/command/user/ssh/CreateSSHKeyPairCmd.java
index c275f80cf3b..abecbe7fb25 100644
--- a/api/src/org/apache/cloudstack/api/command/user/ssh/CreateSSHKeyPairCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/ssh/CreateSSHKeyPairCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.ssh;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -32,7 +33,7 @@
 @APICommand(name = "createSSHKeyPair", description = "Create a new keypair and returns the private key", responseObject = CreateSSHKeyPairResponse.class, entityType = {SSHKeyPair.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class CreateSSHKeyPairCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateSSHKeyPairCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateSSHKeyPairCmd.class.getName());
     private static final String s_name = "createsshkeypairresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/ssh/DeleteSSHKeyPairCmd.java b/api/src/org/apache/cloudstack/api/command/user/ssh/DeleteSSHKeyPairCmd.java
index 92585877352..9d59ecfff9a 100644
--- a/api/src/org/apache/cloudstack/api/command/user/ssh/DeleteSSHKeyPairCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/ssh/DeleteSSHKeyPairCmd.java
@@ -17,7 +17,8 @@
 package org.apache.cloudstack.api.command.user.ssh;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -34,7 +35,7 @@
 @APICommand(name = "deleteSSHKeyPair", description = "Deletes a keypair by name", responseObject = SuccessResponse.class, entityType = {SSHKeyPair.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteSSHKeyPairCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateSSHKeyPairCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateSSHKeyPairCmd.class.getName());
     private static final String s_name = "deletesshkeypairresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/ssh/ListSSHKeyPairsCmd.java b/api/src/org/apache/cloudstack/api/command/user/ssh/ListSSHKeyPairsCmd.java
index 1a77a660dcd..4d925f91d67 100644
--- a/api/src/org/apache/cloudstack/api/command/user/ssh/ListSSHKeyPairsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/ssh/ListSSHKeyPairsCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -34,7 +35,7 @@
 @APICommand(name = "listSSHKeyPairs", description = "List registered keypairs", responseObject = SSHKeyPairResponse.class, entityType = {SSHKeyPair.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListSSHKeyPairsCmd extends BaseListProjectAndAccountResourcesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListSSHKeyPairsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListSSHKeyPairsCmd.class.getName());
     private static final String s_name = "listsshkeypairsresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/ssh/RegisterSSHKeyPairCmd.java b/api/src/org/apache/cloudstack/api/command/user/ssh/RegisterSSHKeyPairCmd.java
index ed9c4cd304e..e6e7166ed14 100644
--- a/api/src/org/apache/cloudstack/api/command/user/ssh/RegisterSSHKeyPairCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/ssh/RegisterSSHKeyPairCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.ssh;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -32,7 +33,7 @@
 @APICommand(name = "registerSSHKeyPair", description = "Register a public key in a keypair under a certain name", responseObject = SSHKeyPairResponse.class, entityType = {SSHKeyPair.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class RegisterSSHKeyPairCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(RegisterSSHKeyPairCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(RegisterSSHKeyPairCmd.class.getName());
     private static final String s_name = "registersshkeypairresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/tag/CreateTagsCmd.java b/api/src/org/apache/cloudstack/api/command/user/tag/CreateTagsCmd.java
index 6aecc055480..5a94a473a5b 100644
--- a/api/src/org/apache/cloudstack/api/command/user/tag/CreateTagsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/tag/CreateTagsCmd.java
@@ -23,7 +23,8 @@
 import java.util.List;
 import java.util.Map;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -40,7 +41,7 @@
 @APICommand(name = "createTags", description = "Creates resource tag(s)", responseObject = SuccessResponse.class, since = "4.0.0", entityType = {ResourceTag.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreateTagsCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateTagsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateTagsCmd.class.getName());
 
     private static final String s_name = "createtagsresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/tag/DeleteTagsCmd.java b/api/src/org/apache/cloudstack/api/command/user/tag/DeleteTagsCmd.java
index e42cfce4d91..a57ca23da2d 100644
--- a/api/src/org/apache/cloudstack/api/command/user/tag/DeleteTagsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/tag/DeleteTagsCmd.java
@@ -23,7 +23,8 @@
 import java.util.List;
 import java.util.Map;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -40,7 +41,7 @@
 @APICommand(name = "deleteTags", description = "Deleting resource tag(s)", responseObject = SuccessResponse.class, since = "4.0.0", entityType = {ResourceTag.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteTagsCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteTagsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteTagsCmd.class.getName());
 
     private static final String s_name = "deletetagsresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/template/CopyTemplateCmd.java b/api/src/org/apache/cloudstack/api/command/user/template/CopyTemplateCmd.java
index d16b87cd95e..6264852c7c1 100644
--- a/api/src/org/apache/cloudstack/api/command/user/template/CopyTemplateCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/template/CopyTemplateCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -42,7 +43,7 @@
 @APICommand(name = "copyTemplate", description = "Copies a template from one zone to another.", responseObject = TemplateResponse.class, responseView = ResponseView.Restricted,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CopyTemplateCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(CopyTemplateCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CopyTemplateCmd.class.getName());
     private static final String s_name = "copytemplateresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/template/CreateTemplateCmd.java b/api/src/org/apache/cloudstack/api/command/user/template/CreateTemplateCmd.java
index 59c4abe0028..c7fb9c1f270 100644
--- a/api/src/org/apache/cloudstack/api/command/user/template/CreateTemplateCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/template/CreateTemplateCmd.java
@@ -28,7 +28,8 @@
 import org.apache.cloudstack.api.response.VolumeResponse;
 import org.apache.cloudstack.api.response.ProjectResponse;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -54,7 +55,7 @@
         + "A template created from this command is automatically designated as a private template visible to the account that created it.", responseView = ResponseView.Restricted,
     requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreateTemplateCmd extends BaseAsyncCreateCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateTemplateCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateTemplateCmd.class.getName());
     private static final String s_name = "createtemplateresponse";
 
     // ///////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/template/DeleteTemplateCmd.java b/api/src/org/apache/cloudstack/api/command/user/template/DeleteTemplateCmd.java
index 98d53be836e..e473dd81c66 100644
--- a/api/src/org/apache/cloudstack/api/command/user/template/DeleteTemplateCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/template/DeleteTemplateCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.template;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -39,7 +40,7 @@
             description = "Deletes a template from the system. All virtual machines using the deleted template will not be affected.",
             requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteTemplateCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteTemplateCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteTemplateCmd.class.getName());
     private static final String s_name = "deletetemplateresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/template/ExtractTemplateCmd.java b/api/src/org/apache/cloudstack/api/command/user/template/ExtractTemplateCmd.java
index 48d3e1405a4..7454a0e6b99 100644
--- a/api/src/org/apache/cloudstack/api/command/user/template/ExtractTemplateCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/template/ExtractTemplateCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.template;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -38,7 +39,7 @@
 @APICommand(name = "extractTemplate", description = "Extracts a template", responseObject = ExtractResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ExtractTemplateCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(ExtractTemplateCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ExtractTemplateCmd.class.getName());
 
     private static final String s_name = "extracttemplateresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/template/GetUploadParamsForTemplateCmd.java b/api/src/org/apache/cloudstack/api/command/user/template/GetUploadParamsForTemplateCmd.java
index 248e892d897..5208f890394 100644
--- a/api/src/org/apache/cloudstack/api/command/user/template/GetUploadParamsForTemplateCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/template/GetUploadParamsForTemplateCmd.java
@@ -31,14 +31,15 @@
 import org.apache.cloudstack.api.response.GetUploadParamsResponse;
 import org.apache.cloudstack.api.response.GuestOSResponse;
 import org.apache.cloudstack.context.CallContext;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.exception.ResourceAllocationException;
 
 @APICommand(name = "getUploadParamsForTemplate", description = "upload an existing template into the CloudStack cloud. ", responseObject = GetUploadParamsResponse.class, since =
     "4.6.0", requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class GetUploadParamsForTemplateCmd extends AbstractGetUploadParamsCmd {
-    public static final Logger s_logger = Logger.getLogger(GetUploadParamsForTemplateCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(GetUploadParamsForTemplateCmd.class.getName());
 
     private static final String s_name = "postuploadtemplateresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/template/ListTemplatePermissionsCmd.java b/api/src/org/apache/cloudstack/api/command/user/template/ListTemplatePermissionsCmd.java
index 48f8ffff586..b87ddb899d0 100644
--- a/api/src/org/apache/cloudstack/api/command/user/template/ListTemplatePermissionsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/template/ListTemplatePermissionsCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.template;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.BaseListTemplateOrIsoPermissionsCmd;
@@ -41,7 +42,7 @@ public String getMediaType() {
 
     @Override
     protected Logger getLogger() {
-        return Logger.getLogger(ListTemplatePermissionsCmd.class.getName());
+        return LogManager.getLogger(ListTemplatePermissionsCmd.class.getName());
     }
 
     @Override
diff --git a/api/src/org/apache/cloudstack/api/command/user/template/ListTemplatesCmd.java b/api/src/org/apache/cloudstack/api/command/user/template/ListTemplatesCmd.java
index 772ca2749e7..22c0a6c3a6f 100644
--- a/api/src/org/apache/cloudstack/api/command/user/template/ListTemplatesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/template/ListTemplatesCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.template;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import java.util.List;
 import org.apache.cloudstack.api.APICommand;
@@ -37,7 +38,7 @@
 @APICommand(name = "listTemplates", description = "List all public, private, and privileged templates.", responseObject = TemplateResponse.class, entityType = {VirtualMachineTemplate.class}, responseView = ResponseView.Restricted,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListTemplatesCmd extends BaseListTaggedResourcesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListTemplatesCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListTemplatesCmd.class.getName());
 
     private static final String s_name = "listtemplatesresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/template/RegisterTemplateCmd.java b/api/src/org/apache/cloudstack/api/command/user/template/RegisterTemplateCmd.java
index 2bd7b2d38d1..370a8d892d3 100644
--- a/api/src/org/apache/cloudstack/api/command/user/template/RegisterTemplateCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/template/RegisterTemplateCmd.java
@@ -37,7 +37,8 @@
 import org.apache.cloudstack.api.response.TemplateResponse;
 import org.apache.cloudstack.api.response.ZoneResponse;
 import org.apache.cloudstack.context.CallContext;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.exception.ResourceAllocationException;
 import com.cloud.template.VirtualMachineTemplate;
@@ -45,7 +46,7 @@
 @APICommand(name = "registerTemplate", description = "Registers an existing template into the CloudStack cloud. ", responseObject = TemplateResponse.class, responseView = ResponseView.Restricted,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class RegisterTemplateCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(RegisterTemplateCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(RegisterTemplateCmd.class.getName());
 
     private static final String s_name = "registertemplateresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/template/UpdateTemplateCmd.java b/api/src/org/apache/cloudstack/api/command/user/template/UpdateTemplateCmd.java
index 0a01e4825a7..5897fe00cd6 100644
--- a/api/src/org/apache/cloudstack/api/command/user/template/UpdateTemplateCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/template/UpdateTemplateCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.template;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiErrorCode;
@@ -31,7 +32,7 @@
 @APICommand(name = "updateTemplate", description = "Updates attributes of a template.", responseObject = TemplateResponse.class, responseView = ResponseView.Restricted,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateTemplateCmd extends BaseUpdateTemplateOrIsoCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateTemplateCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateTemplateCmd.class.getName());
     private static final String s_name = "updatetemplateresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/template/UpdateTemplatePermissionsCmd.java b/api/src/org/apache/cloudstack/api/command/user/template/UpdateTemplatePermissionsCmd.java
index 2029156837e..53ffae4f98a 100644
--- a/api/src/org/apache/cloudstack/api/command/user/template/UpdateTemplatePermissionsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/template/UpdateTemplatePermissionsCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.template;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.BaseUpdateTemplateOrIsoPermissionsCmd;
@@ -37,7 +38,7 @@ protected String getResponseName() {
 
     @Override
     protected Logger getLogger() {
-        return Logger.getLogger(UpdateTemplatePermissionsCmd.class.getName());
+        return LogManager.getLogger(UpdateTemplatePermissionsCmd.class.getName());
     }
 
     @Override
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/AddIpToVmNicCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/AddIpToVmNicCmd.java
index 4b805acc396..e2a0d720524 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/AddIpToVmNicCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/AddIpToVmNicCmd.java
@@ -26,7 +26,8 @@
 import org.apache.cloudstack.api.response.NicResponse;
 import org.apache.cloudstack.api.response.NicSecondaryIpResponse;
 import org.apache.cloudstack.context.CallContext;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.dc.DataCenter;
 import com.cloud.dc.DataCenter.NetworkType;
@@ -46,7 +47,7 @@
 @APICommand(name = "addIpToNic", description = "Assigns secondary IP to NIC", responseObject = NicSecondaryIpResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class AddIpToVmNicCmd extends BaseAsyncCreateCmd {
-    public static final Logger s_logger = Logger.getLogger(AddIpToVmNicCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(AddIpToVmNicCmd.class.getName());
     private static final String s_name = "addiptovmnicresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/AddNicToVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/AddNicToVMCmd.java
index ef03e78bea5..2800952b59c 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/AddNicToVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/AddNicToVMCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.EnumSet;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -45,7 +46,7 @@
 @APICommand(name = "addNicToVirtualMachine", description = "Adds VM to specified network by creating a NIC", responseObject = UserVmResponse.class, responseView = ResponseView.Restricted, entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class AddNicToVMCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(AddNicToVMCmd.class);
+    public static final Logger s_logger = LogManager.getLogger(AddNicToVMCmd.class);
     private static final String s_name = "addnictovirtualmachineresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java
index bd2ae6f9c17..92fee1ed2da 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java
@@ -46,7 +46,8 @@
 import org.apache.cloudstack.api.response.UserVmResponse;
 import org.apache.cloudstack.api.response.ZoneResponse;
 import org.apache.cloudstack.context.CallContext;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.event.EventTypes;
 import com.cloud.exception.ConcurrentOperationException;
@@ -65,7 +66,7 @@
 @APICommand(name = "deployVirtualMachine", description = "Creates and automatically starts a virtual machine based on a service offering, disk offering, and template.", responseObject = UserVmResponse.class, responseView = ResponseView.Restricted, entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class DeployVMCmd extends BaseAsyncCreateCustomIdCmd implements SecurityGroupAction {
-    public static final Logger s_logger = Logger.getLogger(DeployVMCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeployVMCmd.class.getName());
 
     private static final String s_name = "deployvirtualmachineresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/DestroyVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/DestroyVMCmd.java
index f23e03a1437..4eb8f58333b 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/DestroyVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/DestroyVMCmd.java
@@ -18,7 +18,8 @@
 
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -44,7 +45,7 @@
             requestHasSensitiveInfo = false,
             responseHasSensitiveInfo = true)
 public class DestroyVMCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DestroyVMCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DestroyVMCmd.class.getName());
 
     private static final String s_name = "destroyvirtualmachineresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/GetVMPasswordCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/GetVMPasswordCmd.java
index 0ba9db538a5..da7de5191e1 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/GetVMPasswordCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/GetVMPasswordCmd.java
@@ -18,7 +18,8 @@
 
 import java.security.InvalidParameterException;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -36,7 +37,7 @@
 @APICommand(name = "getVMPassword", responseObject = GetVMPasswordResponse.class, description = "Returns an encrypted password for the VM", entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class GetVMPasswordCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(GetVMPasswordCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(GetVMPasswordCmd.class.getName());
     private static final String s_name = "getvmpasswordresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/ListNicsCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/ListNicsCmd.java
index 30a3b8cce90..6183e281b1d 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/ListNicsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/ListNicsCmd.java
@@ -33,7 +33,8 @@
 import org.apache.cloudstack.api.response.NicResponse;
 import org.apache.cloudstack.api.response.UserVmResponse;
 import org.apache.cloudstack.context.CallContext;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.exception.ConcurrentOperationException;
 import com.cloud.exception.InsufficientCapacityException;
@@ -45,7 +46,7 @@
 @APICommand(name = "listNics", description = "list the vm nics  IP to NIC", responseObject = NicResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListNicsCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListNicsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListNicsCmd.class.getName());
     private static final String s_name = "listnicsresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/ListVMsCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/ListVMsCmd.java
index ff6acde755f..15a5c41c685 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/ListVMsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/ListVMsCmd.java
@@ -21,7 +21,8 @@
 import java.util.List;
 
 import org.apache.cloudstack.api.response.UserResponse;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.affinity.AffinityGroupResponse;
@@ -52,7 +53,7 @@
 @APICommand(name = "listVirtualMachines", description = "List the virtual machines owned by the account.", responseObject = UserVmResponse.class, responseView = ResponseView.Restricted, entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class ListVMsCmd extends BaseListTaggedResourcesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListVMsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListVMsCmd.class.getName());
 
     private static final String s_name = "listvirtualmachinesresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/RebootVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/RebootVMCmd.java
index e7a0c16b101..6521777980a 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/RebootVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/RebootVMCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.vm;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -41,7 +42,7 @@
 @APICommand(name = "rebootVirtualMachine", description = "Reboots a virtual machine.", responseObject = UserVmResponse.class, responseView = ResponseView.Restricted, entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class RebootVMCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(RebootVMCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(RebootVMCmd.class.getName());
     private static final String s_name = "rebootvirtualmachineresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/RemoveIpFromVmNicCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/RemoveIpFromVmNicCmd.java
index 19da39a5970..89c0475dfb0 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/RemoveIpFromVmNicCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/RemoveIpFromVmNicCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.vm;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -41,7 +42,7 @@
 @APICommand(name = "removeIpFromNic", description = "Removes secondary IP from the NIC.", responseObject = SuccessResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class RemoveIpFromVmNicCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(RemoveIpFromVmNicCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(RemoveIpFromVmNicCmd.class.getName());
     private static final String s_name = "removeipfromnicresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/RemoveNicFromVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/RemoveNicFromVMCmd.java
index d740260fc63..cbbf015688f 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/RemoveNicFromVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/RemoveNicFromVMCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.EnumSet;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -43,7 +44,7 @@
 @APICommand(name = "removeNicFromVirtualMachine", description = "Removes VM from specified network by deleting a NIC", responseObject = UserVmResponse.class, responseView = ResponseView.Restricted, entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class RemoveNicFromVMCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(RemoveNicFromVMCmd.class);
+    public static final Logger s_logger = LogManager.getLogger(RemoveNicFromVMCmd.class);
     private static final String s_name = "removenicfromvirtualmachineresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/ResetVMPasswordCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/ResetVMPasswordCmd.java
index 365f3ed16a4..8123d54a1a0 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/ResetVMPasswordCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/ResetVMPasswordCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.vm;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -43,7 +44,7 @@
         "support this feature for this command to take effect. [async]", responseView = ResponseView.Restricted, entityType = {VirtualMachine.class},
     requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class ResetVMPasswordCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(ResetVMPasswordCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ResetVMPasswordCmd.class.getName());
 
     private static final String s_name = "resetpasswordforvirtualmachineresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/ResetVMSSHKeyCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/ResetVMSSHKeyCmd.java
index db2c7ff87dc..d6c121d8ff1 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/ResetVMSSHKeyCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/ResetVMSSHKeyCmd.java
@@ -17,7 +17,8 @@
 
 package org.apache.cloudstack.api.command.user.vm;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -46,7 +47,7 @@
     requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class ResetVMSSHKeyCmd extends BaseAsyncCmd {
 
-    public static final Logger s_logger = Logger.getLogger(ResetVMSSHKeyCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ResetVMSSHKeyCmd.class.getName());
 
     private static final String s_name = "resetSSHKeyforvirtualmachineresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/RestoreVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/RestoreVMCmd.java
index 44265a32f5e..ee4808b1a6f 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/RestoreVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/RestoreVMCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.vm;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -44,7 +45,7 @@
             requestHasSensitiveInfo = false,
             responseHasSensitiveInfo = true)
 public class RestoreVMCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(RestoreVMCmd.class);
+    public static final Logger s_logger = LogManager.getLogger(RestoreVMCmd.class);
     private static final String s_name = "restorevmresponse";
 
     @ACL(accessType = AccessType.OperateEntry)
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/ScaleVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/ScaleVMCmd.java
index 661100b533e..a6ec113d1ae 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/ScaleVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/ScaleVMCmd.java
@@ -22,7 +22,8 @@
 import java.util.List;
 import java.util.Map;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -51,7 +52,7 @@
 @APICommand(name = "scaleVirtualMachine", description = "Scales the virtual machine to a new service offering.", responseObject = SuccessResponse.class, responseView = ResponseView.Restricted, entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ScaleVMCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(ScaleVMCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ScaleVMCmd.class.getName());
     private static final String s_name = "scalevirtualmachineresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/StartVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/StartVMCmd.java
index 8289412404f..fbcea71a1a1 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/StartVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/StartVMCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.vm;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
@@ -48,7 +49,7 @@
 @APICommand(name = "startVirtualMachine", responseObject = UserVmResponse.class, description = "Starts a virtual machine.", responseView = ResponseView.Restricted, entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class StartVMCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(StartVMCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(StartVMCmd.class.getName());
 
     private static final String s_name = "startvirtualmachineresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/StopVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/StopVMCmd.java
index 5b2f0208e0b..be2e303a1ab 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/StopVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/StopVMCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.vm;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -40,7 +41,7 @@
 @APICommand(name = "stopVirtualMachine", responseObject = UserVmResponse.class, description = "Stops a virtual machine.", responseView = ResponseView.Restricted, entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class StopVMCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(StopVMCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(StopVMCmd.class.getName());
 
     private static final String s_name = "stopvirtualmachineresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/UpdateDefaultNicForVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/UpdateDefaultNicForVMCmd.java
index cffd9037920..f3af37196a2 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/UpdateDefaultNicForVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/UpdateDefaultNicForVMCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.EnumSet;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -43,7 +44,7 @@
 @APICommand(name = "updateDefaultNicForVirtualMachine", description = "Changes the default NIC on a VM", responseObject = UserVmResponse.class, responseView = ResponseView.Restricted, entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class UpdateDefaultNicForVMCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateDefaultNicForVMCmd.class);
+    public static final Logger s_logger = LogManager.getLogger(UpdateDefaultNicForVMCmd.class);
     private static final String s_name = "updatedefaultnicforvirtualmachineresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java
index eb03f086c69..9670e951cb0 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java
@@ -34,7 +34,8 @@
 import org.apache.cloudstack.api.response.SecurityGroupResponse;
 import org.apache.cloudstack.api.response.UserVmResponse;
 import org.apache.cloudstack.context.CallContext;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.exception.InsufficientCapacityException;
 import com.cloud.exception.ResourceUnavailableException;
@@ -47,7 +48,7 @@
         "Therefore, stop the VM manually before issuing this call.", responseObject = UserVmResponse.class, responseView = ResponseView.Restricted, entityType = {VirtualMachine.class},
     requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class UpdateVMCmd extends BaseCustomIdCmd implements SecurityGroupAction {
-    public static final Logger s_logger = Logger.getLogger(UpdateVMCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateVMCmd.class.getName());
     private static final String s_name = "updatevirtualmachineresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/UpdateVmNicIpCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/UpdateVmNicIpCmd.java
index c6fbedbf631..0b0101fee48 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/UpdateVmNicIpCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/UpdateVmNicIpCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.EnumSet;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -49,7 +50,7 @@
 
 @APICommand(name = "updateVmNicIp", description = "Update the default Ip of a VM Nic", responseObject = UserVmResponse.class)
 public class UpdateVmNicIpCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(AddIpToVmNicCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(AddIpToVmNicCmd.class.getName());
     private static final String s_name = "updatevmnicipresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/UpgradeVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/UpgradeVMCmd.java
index b10555556bd..b3563405c11 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/UpgradeVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/UpgradeVMCmd.java
@@ -21,7 +21,8 @@
 import java.util.Iterator;
 import java.util.Map;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -48,7 +49,7 @@
         "this command to take effect.", responseView = ResponseView.Restricted, entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class UpgradeVMCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(UpgradeVMCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpgradeVMCmd.class.getName());
     private static final String s_name = "changeserviceforvirtualmachineresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/vmgroup/CreateVMGroupCmd.java b/api/src/org/apache/cloudstack/api/command/user/vmgroup/CreateVMGroupCmd.java
index 6947f150594..9f1671d55f9 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vmgroup/CreateVMGroupCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vmgroup/CreateVMGroupCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.vmgroup;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -34,7 +35,7 @@
 @APICommand(name = "createInstanceGroup", description = "Creates a vm group", responseObject = InstanceGroupResponse.class, entityType = {InstanceGroup.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreateVMGroupCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateVMGroupCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateVMGroupCmd.class.getName());
 
     private static final String s_name = "createinstancegroupresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/vmgroup/DeleteVMGroupCmd.java b/api/src/org/apache/cloudstack/api/command/user/vmgroup/DeleteVMGroupCmd.java
index 8311eccf99e..396c249c783 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vmgroup/DeleteVMGroupCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vmgroup/DeleteVMGroupCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.vmgroup;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -35,7 +36,7 @@
 @APICommand(name = "deleteInstanceGroup", description = "Deletes a vm group", responseObject = SuccessResponse.class, entityType = {InstanceGroup.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteVMGroupCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteVMGroupCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteVMGroupCmd.class.getName());
     private static final String s_name = "deleteinstancegroupresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/vmgroup/ListVMGroupsCmd.java b/api/src/org/apache/cloudstack/api/command/user/vmgroup/ListVMGroupsCmd.java
index 73fdb8aa18a..5c221c9db3b 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vmgroup/ListVMGroupsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vmgroup/ListVMGroupsCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.vmgroup;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -30,7 +31,7 @@
 @APICommand(name = "listInstanceGroups", description = "Lists vm groups", responseObject = InstanceGroupResponse.class, entityType = {InstanceGroup.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListVMGroupsCmd extends BaseListProjectAndAccountResourcesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListVMGroupsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListVMGroupsCmd.class.getName());
 
     private static final String s_name = "listinstancegroupsresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/vmgroup/UpdateVMGroupCmd.java b/api/src/org/apache/cloudstack/api/command/user/vmgroup/UpdateVMGroupCmd.java
index befa46c9ce7..767223d4e96 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vmgroup/UpdateVMGroupCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vmgroup/UpdateVMGroupCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.vmgroup;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -36,7 +37,7 @@
 public class UpdateVMGroupCmd extends BaseCmd {
 
     private static final String s_name = "updateinstancegroupresponse";
-    public static final Logger s_logger = Logger.getLogger(UpdateVMGroupCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateVMGroupCmd.class.getName());
 
     /////////////////////////////////////////////////////
     //////////////// API parameters /////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/CreateVMSnapshotCmd.java b/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/CreateVMSnapshotCmd.java
index 3e37bbe5e36..9a6a54024b1 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/CreateVMSnapshotCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/CreateVMSnapshotCmd.java
@@ -17,8 +17,10 @@
 
 package org.apache.cloudstack.api.command.user.vmsnapshot;
 
-import java.util.logging.Logger;
-
+import com.cloud.event.EventTypes;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.uservm.UserVm;
+import com.cloud.vm.snapshot.VMSnapshot;
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
 import org.apache.cloudstack.api.APICommand;
@@ -30,17 +32,14 @@
 import org.apache.cloudstack.api.response.UserVmResponse;
 import org.apache.cloudstack.api.response.VMSnapshotResponse;
 import org.apache.cloudstack.context.CallContext;
-
-import com.cloud.event.EventTypes;
-import com.cloud.exception.ResourceAllocationException;
-import com.cloud.uservm.UserVm;
-import com.cloud.vm.snapshot.VMSnapshot;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 @APICommand(name = "createVMSnapshot", description = "Creates snapshot for a vm.", responseObject = VMSnapshotResponse.class, since = "4.2.0", entityType = {VMSnapshot.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreateVMSnapshotCmd extends BaseAsyncCreateCmd {
 
-    public static final Logger s_logger = Logger.getLogger(CreateVMSnapshotCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateVMSnapshotCmd.class.getName());
     private static final String s_name = "createvmsnapshotresponse";
 
     @ACL(accessType = AccessType.OperateEntry)
diff --git a/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/DeleteVMSnapshotCmd.java b/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/DeleteVMSnapshotCmd.java
index 7baad7cd599..d470064c25f 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/DeleteVMSnapshotCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/DeleteVMSnapshotCmd.java
@@ -17,7 +17,8 @@
 
 package org.apache.cloudstack.api.command.user.vmsnapshot;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -38,7 +39,7 @@
 @APICommand(name = "deleteVMSnapshot", description = "Deletes a vmsnapshot.", responseObject = SuccessResponse.class, since = "4.2.0", entityType = {VMSnapshot.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteVMSnapshotCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteVMSnapshotCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteVMSnapshotCmd.class.getName());
     private static final String s_name = "deletevmsnapshotresponse";
 
     @ACL(accessType = AccessType.OperateEntry)
diff --git a/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/RevertToVMSnapshotCmd.java b/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/RevertToVMSnapshotCmd.java
index 0ca500962b3..de8676fead8 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/RevertToVMSnapshotCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/RevertToVMSnapshotCmd.java
@@ -16,8 +16,14 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.vmsnapshot;
 
-import java.util.logging.Logger;
-
+import com.cloud.event.EventTypes;
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.user.Account;
+import com.cloud.uservm.UserVm;
+import com.cloud.vm.snapshot.VMSnapshot;
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
 import org.apache.cloudstack.api.APICommand;
@@ -30,20 +36,13 @@
 import org.apache.cloudstack.api.response.UserVmResponse;
 import org.apache.cloudstack.api.response.VMSnapshotResponse;
 import org.apache.cloudstack.context.CallContext;
-
-import com.cloud.event.EventTypes;
-import com.cloud.exception.ConcurrentOperationException;
-import com.cloud.exception.InsufficientCapacityException;
-import com.cloud.exception.ResourceAllocationException;
-import com.cloud.exception.ResourceUnavailableException;
-import com.cloud.user.Account;
-import com.cloud.uservm.UserVm;
-import com.cloud.vm.snapshot.VMSnapshot;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 @APICommand(name = "revertToVMSnapshot", description = "Revert VM from a vmsnapshot.", responseObject = UserVmResponse.class, since = "4.2.0", responseView = ResponseView.Restricted,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
 public class RevertToVMSnapshotCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(RevertToVMSnapshotCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(RevertToVMSnapshotCmd.class.getName());
     private static final String s_name = "reverttovmsnapshotresponse";
 
     @ACL(accessType = AccessType.OperateEntry, pointerToEntity = "getVmId()")
diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/AddResourceDetailCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/AddResourceDetailCmd.java
index d53059ed152..baa17e759b5 100644
--- a/api/src/org/apache/cloudstack/api/command/user/volume/AddResourceDetailCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/AddResourceDetailCmd.java
@@ -26,7 +26,8 @@
 import org.apache.cloudstack.api.BaseAsyncCmd;
 import org.apache.cloudstack.api.Parameter;
 import org.apache.cloudstack.api.response.SuccessResponse;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.event.EventTypes;
 import com.cloud.server.ResourceTag;
@@ -34,7 +35,7 @@
 @APICommand(name = "addResourceDetail", description = "Adds detail for the Resource.", responseObject = SuccessResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class AddResourceDetailCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(AddResourceDetailCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(AddResourceDetailCmd.class.getName());
     private static final String s_name = "addresourcedetailresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/AttachVolumeCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/AttachVolumeCmd.java
index 7c2a3293d57..77c46723480 100644
--- a/api/src/org/apache/cloudstack/api/command/user/volume/AttachVolumeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/AttachVolumeCmd.java
@@ -17,7 +17,8 @@
 package org.apache.cloudstack.api.command.user.volume;
 
 import org.apache.cloudstack.api.BaseAsyncCmd;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -40,7 +41,7 @@
 @APICommand(name = "attachVolume", description = "Attaches a disk volume to a virtual machine.", responseObject = VolumeResponse.class, responseView = ResponseView.Restricted, entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class AttachVolumeCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(AttachVolumeCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(AttachVolumeCmd.class.getName());
     private static final String s_name = "attachvolumeresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java
index 54c376e2265..c354e1a8bfb 100644
--- a/api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.volume;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.api.APICommand;
@@ -47,7 +48,7 @@
         Volume.class, VirtualMachine.class},
             requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreateVolumeCmd extends BaseAsyncCreateCustomIdCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateVolumeCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateVolumeCmd.class.getName());
     private static final String s_name = "createvolumeresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/DeleteVolumeCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/DeleteVolumeCmd.java
index 0b0c1b73039..7f41ca54c76 100644
--- a/api/src/org/apache/cloudstack/api/command/user/volume/DeleteVolumeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/DeleteVolumeCmd.java
@@ -15,7 +15,8 @@
 // specific language governing permissions and limitations
 // under the License.
 package org.apache.cloudstack.api.command.user.volume;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -36,7 +37,7 @@
 @APICommand(name = "deleteVolume", description = "Deletes a detached disk volume.", responseObject = SuccessResponse.class, entityType = {Volume.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteVolumeCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteVolumeCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteVolumeCmd.class.getName());
     private static final String s_name = "deletevolumeresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/DetachVolumeCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/DetachVolumeCmd.java
index cad0a7ffe06..9c38a3b72ac 100644
--- a/api/src/org/apache/cloudstack/api/command/user/volume/DetachVolumeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/DetachVolumeCmd.java
@@ -17,7 +17,8 @@
 package org.apache.cloudstack.api.command.user.volume;
 
 import org.apache.cloudstack.api.BaseAsyncCmd;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -41,7 +42,7 @@
 @APICommand(name = "detachVolume", description = "Detaches a disk volume from a virtual machine.", responseObject = VolumeResponse.class, responseView = ResponseView.Restricted, entityType = {VirtualMachine.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DetachVolumeCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DetachVolumeCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DetachVolumeCmd.class.getName());
     private static final String s_name = "detachvolumeresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/ExtractVolumeCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/ExtractVolumeCmd.java
index fc536d3f036..6e7f469ed39 100644
--- a/api/src/org/apache/cloudstack/api/command/user/volume/ExtractVolumeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/ExtractVolumeCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.volume;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -41,7 +42,7 @@
 @APICommand(name = "extractVolume", description = "Extracts volume", responseObject = ExtractResponse.class, entityType = {Volume.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ExtractVolumeCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(ExtractVolumeCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ExtractVolumeCmd.class.getName());
 
     private static final String s_name = "extractvolumeresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/GetUploadParamsForVolumeCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/GetUploadParamsForVolumeCmd.java
index 1342ffc4748..aa520c7b254 100644
--- a/api/src/org/apache/cloudstack/api/command/user/volume/GetUploadParamsForVolumeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/GetUploadParamsForVolumeCmd.java
@@ -30,12 +30,13 @@
 import org.apache.cloudstack.api.response.DiskOfferingResponse;
 import org.apache.cloudstack.api.response.GetUploadParamsResponse;
 import org.apache.cloudstack.context.CallContext;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 @APICommand(name = "getUploadParamsForVolume", description = "Upload a data disk to the cloudstack cloud.", responseObject = GetUploadParamsResponse.class, since = "4.6.0",
     requestHasSensitiveInfo= false, responseHasSensitiveInfo = false)
 public class GetUploadParamsForVolumeCmd extends AbstractGetUploadParamsCmd {
-    public static final Logger s_logger = Logger.getLogger(GetUploadParamsForVolumeCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(GetUploadParamsForVolumeCmd.class.getName());
 
     private static final String s_name = "postuploadvolumeresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/ListVolumesCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/ListVolumesCmd.java
index 554e029fc48..77e1182d927 100644
--- a/api/src/org/apache/cloudstack/api/command/user/volume/ListVolumesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/ListVolumesCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.volume;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import java.util.List;
 import org.apache.cloudstack.acl.RoleType;
@@ -41,7 +42,7 @@
 @APICommand(name = "listVolumes", description = "Lists all volumes.", responseObject = VolumeResponse.class, responseView = ResponseView.Restricted, entityType = {Volume.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListVolumesCmd extends BaseListTaggedResourcesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListVolumesCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListVolumesCmd.class.getName());
 
     private static final String s_name = "listvolumesresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/RemoveResourceDetailCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/RemoveResourceDetailCmd.java
index 6fe576dc63c..db63daccb48 100644
--- a/api/src/org/apache/cloudstack/api/command/user/volume/RemoveResourceDetailCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/RemoveResourceDetailCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.volume;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -31,7 +32,7 @@
 @APICommand(name = "removeResourceDetail", description = "Removes detail for the Resource.", responseObject = SuccessResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class RemoveResourceDetailCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(RemoveResourceDetailCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(RemoveResourceDetailCmd.class.getName());
     private static final String s_name = "removeresourcedetailresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java
index 4ec94494ac1..0d1b25a413b 100644
--- a/api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.volume;
 import org.apache.cloudstack.api.BaseAsyncCmd;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -43,7 +44,7 @@
 @APICommand(name = "resizeVolume", description = "Resizes a volume", responseObject = VolumeResponse.class, responseView = ResponseView.Restricted, entityType = {Volume.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ResizeVolumeCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(ResizeVolumeCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ResizeVolumeCmd.class.getName());
 
     private static final String s_name = "resizevolumeresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/UpdateVolumeCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/UpdateVolumeCmd.java
index e7e3820da41..05357d3afb9 100644
--- a/api/src/org/apache/cloudstack/api/command/user/volume/UpdateVolumeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/UpdateVolumeCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.volume;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
@@ -40,7 +41,7 @@
 @APICommand(name = "updateVolume", description = "Updates the volume.", responseObject = VolumeResponse.class, responseView = ResponseView.Restricted, entityType = {Volume.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateVolumeCmd extends BaseAsyncCustomIdCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateVolumeCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateVolumeCmd.class.getName());
     private static final String s_name = "updatevolumeresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/UploadVolumeCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/UploadVolumeCmd.java
index a48a89b79b4..05bbf574542 100644
--- a/api/src/org/apache/cloudstack/api/command/user/volume/UploadVolumeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/UploadVolumeCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.volume;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -43,7 +44,7 @@
 @APICommand(name = "uploadVolume", description = "Uploads a data disk.", responseObject = VolumeResponse.class, responseView = ResponseView.Restricted, entityType = {Volume.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UploadVolumeCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(UploadVolumeCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UploadVolumeCmd.class.getName());
     private static final String s_name = "uploadvolumeresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpc/CreateStaticRouteCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpc/CreateStaticRouteCmd.java
index 622143fa38d..480174debbe 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpc/CreateStaticRouteCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpc/CreateStaticRouteCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.vpc;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
@@ -43,7 +44,7 @@
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreateStaticRouteCmd extends BaseAsyncCreateCmd {
     private static final String s_name = "createstaticrouteresponse";
-    public static final Logger s_logger = Logger.getLogger(CreateStaticRouteCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateStaticRouteCmd.class.getName());
 
     @Parameter(name = ApiConstants.GATEWAY_ID,
                type = CommandType.UUID,
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpc/CreateVPCCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpc/CreateVPCCmd.java
index e5e50178d9b..1c3f1e2e687 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpc/CreateVPCCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpc/CreateVPCCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.vpc;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.api.APICommand;
@@ -43,7 +44,7 @@
 @APICommand(name = "createVPC", description = "Creates a VPC", responseObject = VpcResponse.class, responseView = ResponseView.Restricted, entityType = {Vpc.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreateVPCCmd extends BaseAsyncCreateCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateVPCCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateVPCCmd.class.getName());
     private static final String s_name = "createvpcresponse";
 
     // ///////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpc/DeleteStaticRouteCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpc/DeleteStaticRouteCmd.java
index 9449e6d534a..c4dd279ae90 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpc/DeleteStaticRouteCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpc/DeleteStaticRouteCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.vpc;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -40,7 +41,7 @@
 @APICommand(name = "deleteStaticRoute", description = "Deletes a static route", responseObject = SuccessResponse.class, entityType = {StaticRoute.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteStaticRouteCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteStaticRouteCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteStaticRouteCmd.class.getName());
     private static final String s_name = "deletestaticrouteresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpc/DeleteVPCCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpc/DeleteVPCCmd.java
index 9d13b63e6a2..ffef325fc70 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpc/DeleteVPCCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpc/DeleteVPCCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.vpc;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -38,7 +39,7 @@
 @APICommand(name = "deleteVPC", description = "Deletes a VPC", responseObject = SuccessResponse.class, entityType = {Vpc.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteVPCCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteVPCCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteVPCCmd.class.getName());
     private static final String s_name = "deletevpcresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpc/ListPrivateGatewaysCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpc/ListPrivateGatewaysCmd.java
index a985e7633c2..48e0057388a 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpc/ListPrivateGatewaysCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpc/ListPrivateGatewaysCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -36,7 +37,7 @@
 @APICommand(name = "listPrivateGateways", description = "List private gateways", responseObject = PrivateGatewayResponse.class, entityType = {VpcGateway.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListPrivateGatewaysCmd extends BaseListProjectAndAccountResourcesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListPrivateGatewaysCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListPrivateGatewaysCmd.class.getName());
 
     private static final String s_name = "listprivategatewaysresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpc/ListVPCOfferingsCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpc/ListVPCOfferingsCmd.java
index 69d7c8b8d1e..d3f092c57ac 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpc/ListVPCOfferingsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpc/ListVPCOfferingsCmd.java
@@ -25,7 +25,8 @@
 import org.apache.cloudstack.api.Parameter;
 import org.apache.cloudstack.api.response.ListResponse;
 import org.apache.cloudstack.api.response.VpcOfferingResponse;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.network.vpc.VpcOffering;
 import com.cloud.utils.Pair;
@@ -33,7 +34,7 @@
 @APICommand(name = "listVPCOfferings", description = "Lists VPC offerings", responseObject = VpcOfferingResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListVPCOfferingsCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListVPCOfferingsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListVPCOfferingsCmd.class.getName());
     private static final String s_name = "listvpcofferingsresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpc/ListVPCsCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpc/ListVPCsCmd.java
index 9531b81f259..9ed4c8d10b0 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpc/ListVPCsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpc/ListVPCsCmd.java
@@ -29,7 +29,8 @@
 import org.apache.cloudstack.api.response.VpcOfferingResponse;
 import org.apache.cloudstack.api.response.VpcResponse;
 import org.apache.cloudstack.api.response.ZoneResponse;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.network.vpc.Vpc;
 import com.cloud.utils.Pair;
@@ -38,7 +39,7 @@
 @APICommand(name = "listVPCs", description = "Lists VPCs", responseObject = VpcResponse.class, responseView = ResponseView.Restricted, entityType = {Vpc.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListVPCsCmd extends BaseListTaggedResourcesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListVPCsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListVPCsCmd.class.getName());
     private static final String s_name = "listvpcsresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpc/RestartVPCCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpc/RestartVPCCmd.java
index ea34c6a9580..85be5fbb1c3 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpc/RestartVPCCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpc/RestartVPCCmd.java
@@ -26,7 +26,8 @@
 import org.apache.cloudstack.api.ServerApiException;
 import org.apache.cloudstack.api.response.SuccessResponse;
 import org.apache.cloudstack.api.response.VpcResponse;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.event.EventTypes;
 import com.cloud.exception.ConcurrentOperationException;
@@ -38,7 +39,7 @@
 @APICommand(name = "restartVPC", description = "Restarts a VPC", responseObject = VpcResponse.class, entityType = {Vpc.class},
 requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class RestartVPCCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(RestartVPCCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(RestartVPCCmd.class.getName());
     private static final String s_name = "restartvpcresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpc/UpdateVPCCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpc/UpdateVPCCmd.java
index 94d0e6efcd4..71e3df7eeb1 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpc/UpdateVPCCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpc/UpdateVPCCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.vpc;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
@@ -38,7 +39,7 @@
 @APICommand(name = "updateVPC", description = "Updates a VPC", responseObject = VpcResponse.class, responseView = ResponseView.Restricted, entityType = {Vpc.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateVPCCmd extends BaseAsyncCustomIdCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateVPCCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateVPCCmd.class.getName());
     private static final String s_name = "updatevpcresponse";
 
     /////////////////////////////////////////////////////
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/AddVpnUserCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/AddVpnUserCmd.java
index 9fd4c5a2dfc..f6b506f7099 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/AddVpnUserCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/AddVpnUserCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.vpn;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -37,7 +38,7 @@
 @APICommand(name = "addVpnUser", description = "Adds vpn users", responseObject = VpnUsersResponse.class, entityType = {VpnUser.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class AddVpnUserCmd extends BaseAsyncCreateCmd {
-    public static final Logger s_logger = Logger.getLogger(AddVpnUserCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(AddVpnUserCmd.class.getName());
 
     private static final String s_name = "addvpnuserresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateRemoteAccessVpnCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateRemoteAccessVpnCmd.java
index 9508fa50e35..62f21ce5783 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateRemoteAccessVpnCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateRemoteAccessVpnCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.vpn;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.api.APICommand;
@@ -40,7 +41,7 @@
 @APICommand(name = "createRemoteAccessVpn", description = "Creates a l2tp/ipsec remote access vpn", responseObject = RemoteAccessVpnResponse.class, entityType = {RemoteAccessVpn.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreateRemoteAccessVpnCmd extends BaseAsyncCreateCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateRemoteAccessVpnCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateRemoteAccessVpnCmd.class.getName());
 
     private static final String s_name = "createremoteaccessvpnresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnConnectionCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnConnectionCmd.java
index c92bc894203..3b6e903db98 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnConnectionCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnConnectionCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.vpn;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.api.APICommand;
@@ -41,7 +42,7 @@
 @APICommand(name = "createVpnConnection", description = "Create site to site vpn connection", responseObject = Site2SiteVpnConnectionResponse.class, entityType = {Site2SiteVpnConnection.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreateVpnConnectionCmd extends BaseAsyncCreateCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateVpnConnectionCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateVpnConnectionCmd.class.getName());
 
     private static final String s_name = "createvpnconnectionresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnCustomerGatewayCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnCustomerGatewayCmd.java
index 5c2cbfe1128..25487745efd 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnCustomerGatewayCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnCustomerGatewayCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.vpn;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.ApiErrorCode;
@@ -35,7 +36,7 @@
 @APICommand(name = "createVpnCustomerGateway", description = "Creates site to site vpn customer gateway", responseObject = Site2SiteCustomerGatewayResponse.class, entityType = {Site2SiteCustomerGateway.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreateVpnCustomerGatewayCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateVpnCustomerGatewayCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateVpnCustomerGatewayCmd.class.getName());
 
     private static final String s_name = "createvpncustomergatewayresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnGatewayCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnGatewayCmd.java
index 3043edcb048..4cb8bbd2f17 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnGatewayCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnGatewayCmd.java
@@ -31,12 +31,13 @@
 import org.apache.cloudstack.api.response.Site2SiteVpnGatewayResponse;
 import org.apache.cloudstack.api.response.VpcResponse;
 import org.apache.cloudstack.context.CallContext;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 @APICommand(name = "createVpnGateway", description = "Creates site to site vpn local gateway", responseObject = Site2SiteVpnGatewayResponse.class, entityType = {Site2SiteVpnGateway.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreateVpnGatewayCmd extends BaseAsyncCreateCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateVpnGatewayCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateVpnGatewayCmd.class.getName());
 
     private static final String s_name = "createvpngatewayresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteRemoteAccessVpnCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteRemoteAccessVpnCmd.java
index 12ab531375f..092089df2c8 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteRemoteAccessVpnCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteRemoteAccessVpnCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.vpn;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -37,7 +38,7 @@
 @APICommand(name = "deleteRemoteAccessVpn", description = "Destroys a l2tp/ipsec remote access vpn", responseObject = SuccessResponse.class, entityType = {RemoteAccessVpn.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteRemoteAccessVpnCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteRemoteAccessVpnCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteRemoteAccessVpnCmd.class.getName());
 
     private static final String s_name = "deleteremoteaccessvpnresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnConnectionCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnConnectionCmd.java
index a76b0c804eb..7f79cd7113e 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnConnectionCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnConnectionCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.vpn;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -35,7 +36,7 @@
 @APICommand(name = "deleteVpnConnection", description = "Delete site to site vpn connection", responseObject = SuccessResponse.class, entityType = {Site2SiteVpnConnection.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteVpnConnectionCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteVpnConnectionCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteVpnConnectionCmd.class.getName());
 
     private static final String s_name = "deletevpnconnectionresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnCustomerGatewayCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnCustomerGatewayCmd.java
index aad69ce0a9a..fa91d2e5cdf 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnCustomerGatewayCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnCustomerGatewayCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.vpn;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.ACL;
@@ -36,7 +37,7 @@
 @APICommand(name = "deleteVpnCustomerGateway", description = "Delete site to site vpn customer gateway", responseObject = SuccessResponse.class, entityType = {Site2SiteCustomerGateway.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteVpnCustomerGatewayCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteVpnCustomerGatewayCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteVpnCustomerGatewayCmd.class.getName());
 
     private static final String s_name = "deletevpncustomergatewayresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnGatewayCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnGatewayCmd.java
index ff927408a24..fb24906ead3 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnGatewayCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnGatewayCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.vpn;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -34,7 +35,7 @@
 @APICommand(name = "deleteVpnGateway", description = "Delete site to site vpn gateway", responseObject = SuccessResponse.class, entityType = {Site2SiteVpnGateway.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteVpnGatewayCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteVpnGatewayCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteVpnGatewayCmd.class.getName());
 
     private static final String s_name = "deletevpngatewayresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/ListRemoteAccessVpnsCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/ListRemoteAccessVpnsCmd.java
index 492eaccefa5..aa74670d723 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/ListRemoteAccessVpnsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/ListRemoteAccessVpnsCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.api.APICommand;
@@ -37,7 +38,7 @@
 @APICommand(name = "listRemoteAccessVpns", description = "Lists remote access vpns", responseObject = RemoteAccessVpnResponse.class, entityType = {RemoteAccessVpn.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListRemoteAccessVpnsCmd extends BaseListProjectAndAccountResourcesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListRemoteAccessVpnsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListRemoteAccessVpnsCmd.class.getName());
 
     private static final String s_name = "listremoteaccessvpnsresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnConnectionsCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnConnectionsCmd.java
index 74b9325eb22..c77ecc9dd24 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnConnectionsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnConnectionsCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.api.APICommand;
@@ -36,7 +37,7 @@
 @APICommand(name = "listVpnConnections", description = "Lists site to site vpn connection gateways", responseObject = Site2SiteVpnConnectionResponse.class, entityType = {Site2SiteVpnConnection.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListVpnConnectionsCmd extends BaseListProjectAndAccountResourcesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListVpnConnectionsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListVpnConnectionsCmd.class.getName());
 
     private static final String s_name = "listvpnconnectionsresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnCustomerGatewaysCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnCustomerGatewaysCmd.java
index 6b870be138d..420d4dc1e35 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnCustomerGatewaysCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnCustomerGatewaysCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -34,7 +35,7 @@
 @APICommand(name = "listVpnCustomerGateways", description = "Lists site to site vpn customer gateways", responseObject = Site2SiteCustomerGatewayResponse.class, entityType = {Site2SiteCustomerGateway.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListVpnCustomerGatewaysCmd extends BaseListProjectAndAccountResourcesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListVpnCustomerGatewaysCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListVpnCustomerGatewaysCmd.class.getName());
 
     private static final String s_name = "listvpncustomergatewaysresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnGatewaysCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnGatewaysCmd.java
index 3eade028804..72f877b36d3 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnGatewaysCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnGatewaysCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.api.APICommand;
@@ -36,7 +37,7 @@
 @APICommand(name = "listVpnGateways", description = "Lists site 2 site vpn gateways", responseObject = Site2SiteVpnGatewayResponse.class, entityType = {Site2SiteVpnGateway.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListVpnGatewaysCmd extends BaseListProjectAndAccountResourcesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListVpnGatewaysCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListVpnGatewaysCmd.class.getName());
 
     private static final String s_name = "listvpngatewaysresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnUsersCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnUsersCmd.java
index 9af060ac00f..9c06d836fc8 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnUsersCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnUsersCmd.java
@@ -19,7 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -34,7 +35,7 @@
 @APICommand(name = "listVpnUsers", description = "Lists vpn users", responseObject = VpnUsersResponse.class, entityType = {VpnUser.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListVpnUsersCmd extends BaseListProjectAndAccountResourcesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListVpnUsersCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListVpnUsersCmd.class.getName());
 
     private static final String s_name = "listvpnusersresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/RemoveVpnUserCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/RemoveVpnUserCmd.java
index 140bdad717f..b751009b822 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/RemoveVpnUserCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/RemoveVpnUserCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.vpn;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -36,7 +37,7 @@
 @APICommand(name = "removeVpnUser", description = "Removes vpn user", responseObject = SuccessResponse.class, entityType = {VpnUser.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class RemoveVpnUserCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(RemoveVpnUserCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(RemoveVpnUserCmd.class.getName());
 
     private static final String s_name = "removevpnuserresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/ResetVpnConnectionCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/ResetVpnConnectionCmd.java
index 75e74adcda0..0ab79cb3ce9 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/ResetVpnConnectionCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/ResetVpnConnectionCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.vpn;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -36,7 +37,7 @@
 @APICommand(name = "resetVpnConnection", description = "Reset site to site vpn connection", responseObject = Site2SiteVpnConnectionResponse.class, entityType = {Site2SiteVpnConnection.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ResetVpnConnectionCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(ResetVpnConnectionCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ResetVpnConnectionCmd.class.getName());
 
     private static final String s_name = "resetvpnconnectionresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateRemoteAccessVpnCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateRemoteAccessVpnCmd.java
index 08d3b0a5cd4..6062fa2445b 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateRemoteAccessVpnCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateRemoteAccessVpnCmd.java
@@ -23,7 +23,8 @@
 import org.apache.cloudstack.api.Parameter;
 import org.apache.cloudstack.api.response.AccountResponse;
 import org.apache.cloudstack.api.response.RemoteAccessVpnResponse;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.event.EventTypes;
 import com.cloud.exception.InvalidParameterValueException;
@@ -32,7 +33,7 @@
 @APICommand(name = "updateRemoteAccessVpn", description = "Updates remote access vpn", responseObject = RemoteAccessVpnResponse.class, since = "4.4",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateRemoteAccessVpnCmd extends BaseAsyncCustomIdCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateRemoteAccessVpnCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateRemoteAccessVpnCmd.class.getName());
 
     private static final String s_name = "updateremoteaccessvpnresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateVpnConnectionCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateVpnConnectionCmd.java
index 282afe04267..d7d066799d5 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateVpnConnectionCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateVpnConnectionCmd.java
@@ -22,7 +22,8 @@
 import org.apache.cloudstack.api.BaseAsyncCustomIdCmd;
 import org.apache.cloudstack.api.Parameter;
 import org.apache.cloudstack.api.response.Site2SiteVpnConnectionResponse;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.event.EventTypes;
 import com.cloud.network.Site2SiteVpnConnection;
@@ -31,7 +32,7 @@
 @APICommand(name = "updateVpnConnection", description = "Updates site to site vpn connection", responseObject = Site2SiteVpnConnectionResponse.class, since = "4.4",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateVpnConnectionCmd extends BaseAsyncCustomIdCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateVpnConnectionCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateVpnConnectionCmd.class.getName());
 
     private static final String s_name = "updatevpnconnectionresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateVpnCustomerGatewayCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateVpnCustomerGatewayCmd.java
index bb5914111b4..216158766da 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateVpnCustomerGatewayCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateVpnCustomerGatewayCmd.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.vpn;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -34,7 +35,7 @@
 @APICommand(name = "updateVpnCustomerGateway", description = "Update site to site vpn customer gateway", responseObject = Site2SiteCustomerGatewayResponse.class, entityType = {Site2SiteCustomerGateway.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateVpnCustomerGatewayCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateVpnCustomerGatewayCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateVpnCustomerGatewayCmd.class.getName());
 
     private static final String s_name = "updatevpncustomergatewayresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateVpnGatewayCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateVpnGatewayCmd.java
index bbe820a83c4..de1deb89a9a 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateVpnGatewayCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateVpnGatewayCmd.java
@@ -22,7 +22,8 @@
 import org.apache.cloudstack.api.BaseAsyncCustomIdCmd;
 import org.apache.cloudstack.api.Parameter;
 import org.apache.cloudstack.api.response.Site2SiteVpnGatewayResponse;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.event.EventTypes;
 import com.cloud.network.Site2SiteVpnGateway;
@@ -31,7 +32,7 @@
 @APICommand(name = "updateVpnGateway", description = "Updates site to site vpn local gateway", responseObject = Site2SiteVpnGatewayResponse.class, since = "4.4",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class UpdateVpnGatewayCmd extends BaseAsyncCustomIdCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateVpnGatewayCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UpdateVpnGatewayCmd.class.getName());
 
     private static final String s_name = "updatevpngatewayresponse";
 
diff --git a/api/src/org/apache/cloudstack/api/command/user/zone/ListZonesCmd.java b/api/src/org/apache/cloudstack/api/command/user/zone/ListZonesCmd.java
index 34a5440fb64..31999f15a4d 100644
--- a/api/src/org/apache/cloudstack/api/command/user/zone/ListZonesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/zone/ListZonesCmd.java
@@ -21,7 +21,8 @@
 import java.util.Iterator;
 import java.util.Map;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -37,7 +38,7 @@
 @APICommand(name = "listZones", description = "Lists zones", responseObject = ZoneResponse.class, responseView = ResponseView.Restricted,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListZonesCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListZonesCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListZonesCmd.class.getName());
 
     private static final String s_name = "listzonesresponse";
 
diff --git a/api/src/org/apache/cloudstack/context/CallContext.java b/api/src/org/apache/cloudstack/context/CallContext.java
index fb83f868914..822092ecb83 100644
--- a/api/src/org/apache/cloudstack/context/CallContext.java
+++ b/api/src/org/apache/cloudstack/context/CallContext.java
@@ -21,18 +21,17 @@
 import java.util.Stack;
 import java.util.UUID;
 
-import com.cloud.projects.Project;
-import org.apache.log4j.Logger;
-import org.apache.log4j.NDC;
-
-import org.apache.cloudstack.managed.threadlocal.ManagedThreadLocal;
-
 import com.cloud.exception.CloudAuthenticationException;
+import com.cloud.projects.Project;
 import com.cloud.user.Account;
 import com.cloud.user.User;
 import com.cloud.utils.UuidUtils;
 import com.cloud.utils.db.EntityManager;
 import com.cloud.utils.exception.CloudRuntimeException;
+import org.apache.cloudstack.managed.threadlocal.ManagedThreadLocal;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.ThreadContext;
 
 /**
  * CallContext records information about the environment the call is made.  This
@@ -40,7 +39,7 @@
  * entry point must set the context and remove it when the thread finishes.
  */
 public class CallContext {
-    private static final Logger s_logger = Logger.getLogger(CallContext.class);
+    private static final Logger s_logger = LogManager.getLogger(CallContext.class);
     private static ManagedThreadLocal<CallContext> s_currentContext = new ManagedThreadLocal<CallContext>();
     private static ManagedThreadLocal<Stack<CallContext>> s_currentContextStack = new ManagedThreadLocal<Stack<CallContext>>() {
         @Override
@@ -171,7 +170,7 @@ protected static CallContext register(User callingUser, Account callingAccount,
             callingContext = new CallContext(userId, accountId, contextId);
         }
         s_currentContext.set(callingContext);
-        NDC.push("ctx-" + UuidUtils.first(contextId));
+        ThreadContext.push("ctx-" + UuidUtils.first(contextId));
         if (s_logger.isTraceEnabled()) {
             s_logger.trace("Registered: " + callingContext);
         }
@@ -261,13 +260,13 @@ public static CallContext unregister() {
         }
         String contextId = context.getContextId();
         String sessionIdOnStack = null;
-        String sessionIdPushedToNDC = "ctx-" + UuidUtils.first(contextId);
-        while ((sessionIdOnStack = NDC.pop()) != null) {
-            if (sessionIdOnStack.isEmpty() || sessionIdPushedToNDC.equals(sessionIdOnStack)) {
+        String sessionIdPushedToThreadContext = "ctx-" + UuidUtils.first(contextId);
+        while ((sessionIdOnStack = ThreadContext.pop()) != null) {
+            if (sessionIdOnStack.isEmpty() || sessionIdPushedToThreadContext.equals(sessionIdOnStack)) {
                 break;
             }
             if (s_logger.isTraceEnabled()) {
-                s_logger.trace("Popping from NDC: " + contextId);
+                s_logger.trace("Popping from ThreadContext: " + contextId);
             }
         }
 
diff --git a/api/src/org/apache/cloudstack/context/LogContext.java b/api/src/org/apache/cloudstack/context/LogContext.java
index 9bc9ed738ec..64419308089 100644
--- a/api/src/org/apache/cloudstack/context/LogContext.java
+++ b/api/src/org/apache/cloudstack/context/LogContext.java
@@ -20,8 +20,8 @@
 import java.util.Map;
 import java.util.UUID;
 
-import org.apache.log4j.Logger;
-import org.slf4j.MDC;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.managed.threadlocal.ManagedThreadLocal;
 
@@ -31,13 +31,14 @@
 import com.cloud.utils.UuidUtils;
 import com.cloud.utils.db.EntityManager;
 import com.cloud.utils.exception.CloudRuntimeException;
+import org.apache.logging.log4j.ThreadContext;
 
 /**
  * LogContext records information about the environment the API call is made.  This
  * class must be always be available in all CloudStack code.
  */
 public class LogContext {
-    private static final Logger s_logger = Logger.getLogger(LogContext.class);
+    private static final Logger s_logger = LogManager.getLogger(LogContext.class);
     private static ManagedThreadLocal<LogContext> s_currentContext = new ManagedThreadLocal<LogContext>();
 
     private String logContextId;
@@ -134,7 +135,7 @@ protected static LogContext register(User callingUser, Account callingAccount, L
             callingContext = new LogContext(userId, accountId, contextId);
         }
         s_currentContext.set(callingContext);
-        MDC.put("logcontextid", UuidUtils.first(contextId));
+        ThreadContext.put("logcontextid", UuidUtils.first(contextId));
         if (s_logger.isTraceEnabled()) {
             s_logger.trace("Registered for log: " + callingContext);
         }
@@ -210,7 +211,7 @@ public static void unregister() {
                 s_logger.trace("Unregistered: " + context);
             }
         }
-        MDC.clear();
+        ThreadContext.clearMap();
     }
 
     public void setStartEventId(long startEventId) {
diff --git a/api/test/org/apache/cloudstack/api/command/admin/account/CreateAccountCmdTest.java b/api/test/org/apache/cloudstack/api/command/admin/account/CreateAccountCmdTest.java
index b50b2269c17..f0e5c330aed 100644
--- a/api/test/org/apache/cloudstack/api/command/admin/account/CreateAccountCmdTest.java
+++ b/api/test/org/apache/cloudstack/api/command/admin/account/CreateAccountCmdTest.java
@@ -22,7 +22,8 @@
 import org.apache.cloudstack.api.ApiErrorCode;
 import org.apache.cloudstack.api.ServerApiException;
 import org.apache.cloudstack.context.CallContext;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
@@ -38,7 +39,7 @@
 import com.cloud.user.User;
 
 public class CreateAccountCmdTest {
-    public static final Logger s_logger = Logger.getLogger(CreateAccountCmdTest.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateAccountCmdTest.class.getName());
 
     @Mock
     private AccountService accountService;
diff --git a/api/test/org/apache/cloudstack/api/command/admin/user/CreateUserCmdTest.java b/api/test/org/apache/cloudstack/api/command/admin/user/CreateUserCmdTest.java
index cde3b2da87f..06dc5cbb901 100644
--- a/api/test/org/apache/cloudstack/api/command/admin/user/CreateUserCmdTest.java
+++ b/api/test/org/apache/cloudstack/api/command/admin/user/CreateUserCmdTest.java
@@ -22,7 +22,8 @@
 import org.apache.cloudstack.api.ApiErrorCode;
 import org.apache.cloudstack.api.ServerApiException;
 import org.apache.cloudstack.context.CallContext;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
@@ -38,7 +39,7 @@
 import com.cloud.user.User;
 
 public class CreateUserCmdTest {
-    public static final Logger s_logger = Logger.getLogger(CreateUserCmdTest.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateUserCmdTest.class.getName());
 
     @Mock
     private AccountService accountService;
diff --git a/client/conf/log4j-cloud.xml.in b/client/conf/log4j-cloud.xml.in
index 223692881de..d36149545ae 100755
--- a/client/conf/log4j-cloud.xml.in
+++ b/client/conf/log4j-cloud.xml.in
@@ -20,7 +20,6 @@ under the License.
 <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
 
 <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
-   <throwableRenderer class="com.cloud.utils.log.CglibThrowableRenderer"/>
 
    <!-- ================================= -->
    <!-- Preserve messages in a local file -->
diff --git a/core/src/com/cloud/agent/api/SecurityGroupRulesCmd.java b/core/src/com/cloud/agent/api/SecurityGroupRulesCmd.java
index fe4ac1cdc2e..ef4e70e589e 100644
--- a/core/src/com/cloud/agent/api/SecurityGroupRulesCmd.java
+++ b/core/src/com/cloud/agent/api/SecurityGroupRulesCmd.java
@@ -27,7 +27,8 @@
 
 import org.apache.commons.codec.binary.Base64;
 import org.apache.commons.codec.digest.DigestUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.agent.api.LogLevel.Log4jLevel;
 import com.cloud.utils.net.NetUtils;
@@ -38,7 +39,7 @@
     private static final char RULE_COMMAND_SEPARATOR = ':';
     protected static final String EGRESS_RULE = "E:";
     protected static final String INGRESS_RULE = "I:";
-    private static final Logger LOGGER = Logger.getLogger(SecurityGroupRulesCmd.class);
+    private static final Logger LOGGER = LogManager.getLogger(SecurityGroupRulesCmd.class);
 
     private final String guestIp;
     private final String guestIp6;
diff --git a/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java b/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java
index d7c3d56f9b9..07d140fa5d0 100644
--- a/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java
+++ b/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java
@@ -40,7 +40,8 @@
 import org.apache.cloudstack.ca.SetupKeyStoreCommand;
 import org.apache.cloudstack.ca.SetupKeystoreAnswer;
 import org.apache.cloudstack.utils.security.KeyStoreUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.agent.api.Answer;
 import com.cloud.agent.api.CheckRouterAnswer;
@@ -70,7 +71,7 @@
  **/
 public class VirtualRoutingResource {
 
-    private static final Logger s_logger = Logger.getLogger(VirtualRoutingResource.class);
+    private static final Logger s_logger = LogManager.getLogger(VirtualRoutingResource.class);
     private VirtualRouterDeployer _vrDeployer;
     private Map<String, Queue<NetworkElementCommand>> _vrAggregateCommandsSet;
     protected Map<String, Lock> _vrLockMap = new HashMap<String, Lock>();
diff --git a/core/src/com/cloud/agent/resource/virtualnetwork/facade/SetNetworkAclConfigItem.java b/core/src/com/cloud/agent/resource/virtualnetwork/facade/SetNetworkAclConfigItem.java
index 7247766e5c6..07a8d028c71 100644
--- a/core/src/com/cloud/agent/resource/virtualnetwork/facade/SetNetworkAclConfigItem.java
+++ b/core/src/com/cloud/agent/resource/virtualnetwork/facade/SetNetworkAclConfigItem.java
@@ -22,7 +22,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.agent.api.routing.NetworkElementCommand;
 import com.cloud.agent.api.routing.SetNetworkACLCommand;
@@ -41,7 +42,7 @@
 
 public class SetNetworkAclConfigItem extends AbstractConfigItemFacade {
 
-    public static final Logger s_logger = Logger.getLogger(SetNetworkAclConfigItem.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(SetNetworkAclConfigItem.class.getName());
 
     @Override
     public List<ConfigItem> generateConfig(final NetworkElementCommand cmd) {
diff --git a/core/src/com/cloud/agent/transport/LoggingExclusionStrategy.java b/core/src/com/cloud/agent/transport/LoggingExclusionStrategy.java
index 90e964e7139..705c41aeeb4 100644
--- a/core/src/com/cloud/agent/transport/LoggingExclusionStrategy.java
+++ b/core/src/com/cloud/agent/transport/LoggingExclusionStrategy.java
@@ -19,14 +19,12 @@
 
 package com.cloud.agent.transport;
 
-import org.apache.log4j.Logger;
-
-import com.google.gson.ExclusionStrategy;
-import com.google.gson.FieldAttributes;
-
 import com.cloud.agent.api.Command;
 import com.cloud.agent.api.LogLevel;
 import com.cloud.agent.api.LogLevel.Log4jLevel;
+import com.google.gson.ExclusionStrategy;
+import com.google.gson.FieldAttributes;
+import org.apache.logging.log4j.Logger;
 
 public class LoggingExclusionStrategy implements ExclusionStrategy {
     Logger _logger = null;
diff --git a/core/src/com/cloud/agent/transport/Request.java b/core/src/com/cloud/agent/transport/Request.java
index 09f6bd4ace0..341e2eae976 100644
--- a/core/src/com/cloud/agent/transport/Request.java
+++ b/core/src/com/cloud/agent/transport/Request.java
@@ -32,8 +32,9 @@
 import java.util.zip.GZIPInputStream;
 import java.util.zip.GZIPOutputStream;
 
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.google.gson.Gson;
 import com.google.gson.JsonArray;
@@ -75,7 +76,7 @@
  *
  */
 public class Request {
-    private static final Logger s_logger = Logger.getLogger(Request.class);
+    private static final Logger s_logger = LogManager.getLogger(Request.class);
 
     protected static final Gson s_gson = GsonHelper.getGson();
     protected static final Gson s_gogger = GsonHelper.getGsonLogger();
diff --git a/core/src/com/cloud/network/HAProxyConfigurator.java b/core/src/com/cloud/network/HAProxyConfigurator.java
index d3db0db6132..b81e0cd5337 100644
--- a/core/src/com/cloud/network/HAProxyConfigurator.java
+++ b/core/src/com/cloud/network/HAProxyConfigurator.java
@@ -27,7 +27,8 @@
 import java.util.Map;
 import java.util.Set;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.agent.api.routing.LoadBalancerConfigCommand;
 import com.cloud.agent.api.to.LoadBalancerTO;
@@ -40,7 +41,7 @@
 
 public class HAProxyConfigurator implements LoadBalancerConfigurator {
 
-    private static final Logger s_logger = Logger.getLogger(HAProxyConfigurator.class);
+    private static final Logger s_logger = LogManager.getLogger(HAProxyConfigurator.class);
     private static final String blankLine = "\t ";
     private static String[] globalSection = {"global", "\tlog 127.0.0.1:3914   local0 warning", "\tmaxconn 4096", "\tmaxpipes 1024", "\tchroot /var/lib/haproxy",
         "\tuser haproxy", "\tgroup haproxy", "\tdaemon"};
diff --git a/core/src/com/cloud/network/resource/TrafficSentinelResource.java b/core/src/com/cloud/network/resource/TrafficSentinelResource.java
index e4193327e78..0e1641b6edb 100644
--- a/core/src/com/cloud/network/resource/TrafficSentinelResource.java
+++ b/core/src/com/cloud/network/resource/TrafficSentinelResource.java
@@ -35,7 +35,8 @@
 
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.agent.IAgentControl;
 import com.cloud.agent.api.Answer;
@@ -66,7 +67,7 @@
     private String _inclZones;
     private String _exclZones;
 
-    private static final Logger s_logger = Logger.getLogger(TrafficSentinelResource.class);
+    private static final Logger s_logger = LogManager.getLogger(TrafficSentinelResource.class);
 
     @Override
     public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
diff --git a/core/src/com/cloud/resource/RequestWrapper.java b/core/src/com/cloud/resource/RequestWrapper.java
index 4e754d60a29..ed088204065 100644
--- a/core/src/com/cloud/resource/RequestWrapper.java
+++ b/core/src/com/cloud/resource/RequestWrapper.java
@@ -23,14 +23,15 @@
 import java.util.Hashtable;
 import java.util.Set;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.agent.api.Answer;
 import com.cloud.agent.api.Command;
 
 public abstract class RequestWrapper {
 
-    private static final Logger s_logger = Logger.getLogger(RequestWrapper.class);
+    private static final Logger s_logger = LogManager.getLogger(RequestWrapper.class);
 
     @SuppressWarnings("rawtypes")
     protected Hashtable<Class<? extends ServerResource>, Hashtable<Class<? extends Command>, CommandWrapper>> resources = new Hashtable<Class<? extends ServerResource>, Hashtable<Class<? extends Command>, CommandWrapper>>();
diff --git a/core/src/com/cloud/resource/ServerResourceBase.java b/core/src/com/cloud/resource/ServerResourceBase.java
index f68bcf409ef..48c1eea5322 100644
--- a/core/src/com/cloud/resource/ServerResourceBase.java
+++ b/core/src/com/cloud/resource/ServerResourceBase.java
@@ -32,7 +32,8 @@
 
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.agent.IAgentControl;
 import com.cloud.agent.api.Answer;
@@ -42,7 +43,7 @@
 import com.cloud.utils.script.Script;
 
 public abstract class ServerResourceBase implements ServerResource {
-    private static final Logger s_logger = Logger.getLogger(ServerResourceBase.class);
+    private static final Logger s_logger = LogManager.getLogger(ServerResourceBase.class);
     protected String _name;
     private ArrayList<String> _warnings = new ArrayList<String>();
     private ArrayList<String> _errors = new ArrayList<String>();
diff --git a/core/src/com/cloud/serializer/GsonHelper.java b/core/src/com/cloud/serializer/GsonHelper.java
index 7ac85d39317..59d102b3f55 100644
--- a/core/src/com/cloud/serializer/GsonHelper.java
+++ b/core/src/com/cloud/serializer/GsonHelper.java
@@ -21,7 +21,8 @@
 
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.google.gson.Gson;
 import com.google.gson.GsonBuilder;
@@ -40,7 +41,7 @@
 import com.cloud.utils.Pair;
 
 public class GsonHelper {
-    private static final Logger s_logger = Logger.getLogger(GsonHelper.class);
+    private static final Logger s_logger = LogManager.getLogger(GsonHelper.class);
 
     protected static final Gson s_gson;
     protected static final Gson s_gogger;
diff --git a/core/src/com/cloud/serializer/SerializerHelper.java b/core/src/com/cloud/serializer/SerializerHelper.java
index 5ce05ab1949..7f2a7456e9b 100644
--- a/core/src/com/cloud/serializer/SerializerHelper.java
+++ b/core/src/com/cloud/serializer/SerializerHelper.java
@@ -27,7 +27,8 @@
 import java.util.Date;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.google.gson.Gson;
 
@@ -38,7 +39,7 @@
  * Note: toPairList and appendPairList only support simple POJO objects currently
  */
 public class SerializerHelper {
-    public static final Logger s_logger = Logger.getLogger(SerializerHelper.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(SerializerHelper.class.getName());
     public static final String token = "/";
 
     public static String toSerializedStringOld(Object result) {
diff --git a/core/src/com/cloud/storage/resource/StorageSubsystemCommandHandlerBase.java b/core/src/com/cloud/storage/resource/StorageSubsystemCommandHandlerBase.java
index d9d2993dbaf..7a939bf6054 100644
--- a/core/src/com/cloud/storage/resource/StorageSubsystemCommandHandlerBase.java
+++ b/core/src/com/cloud/storage/resource/StorageSubsystemCommandHandlerBase.java
@@ -19,7 +19,8 @@
 
 package com.cloud.storage.resource;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.storage.command.AttachCommand;
 import org.apache.cloudstack.storage.command.CopyCommand;
@@ -42,7 +43,7 @@
 import com.cloud.storage.Volume;
 
 public class StorageSubsystemCommandHandlerBase implements StorageSubsystemCommandHandler {
-    private static final Logger s_logger = Logger.getLogger(StorageSubsystemCommandHandlerBase.class);
+    private static final Logger s_logger = LogManager.getLogger(StorageSubsystemCommandHandlerBase.class);
     protected StorageProcessor processor;
 
     public StorageSubsystemCommandHandlerBase(StorageProcessor processor) {
diff --git a/core/src/com/cloud/storage/template/FtpTemplateUploader.java b/core/src/com/cloud/storage/template/FtpTemplateUploader.java
index eb0c4f84601..988845b25b2 100644
--- a/core/src/com/cloud/storage/template/FtpTemplateUploader.java
+++ b/core/src/com/cloud/storage/template/FtpTemplateUploader.java
@@ -29,11 +29,12 @@
 import java.net.URLConnection;
 import java.util.Date;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class FtpTemplateUploader implements TemplateUploader {
 
-    public static final Logger s_logger = Logger.getLogger(FtpTemplateUploader.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(FtpTemplateUploader.class.getName());
     public TemplateUploader.Status status = TemplateUploader.Status.NOT_STARTED;
     public String errorString = "";
     public long totalBytes = 0;
diff --git a/core/src/com/cloud/storage/template/HttpTemplateDownloader.java b/core/src/com/cloud/storage/template/HttpTemplateDownloader.java
index d3c23a1fddb..53819f08023 100644
--- a/core/src/com/cloud/storage/template/HttpTemplateDownloader.java
+++ b/core/src/com/cloud/storage/template/HttpTemplateDownloader.java
@@ -41,7 +41,8 @@
 import org.apache.commons.httpclient.auth.AuthScope;
 import org.apache.commons.httpclient.methods.GetMethod;
 import org.apache.commons.httpclient.params.HttpMethodParams;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.managed.context.ManagedContextRunnable;
 import org.apache.cloudstack.storage.command.DownloadCommand.ResourceType;
@@ -56,7 +57,7 @@
  *
  */
 public class HttpTemplateDownloader extends ManagedContextRunnable implements TemplateDownloader {
-    public static final Logger s_logger = Logger.getLogger(HttpTemplateDownloader.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(HttpTemplateDownloader.class.getName());
     private static final MultiThreadedHttpConnectionManager s_httpClientManager = new MultiThreadedHttpConnectionManager();
 
     private static final int CHUNK_SIZE = 1024 * 1024; //1M
diff --git a/core/src/com/cloud/storage/template/IsoProcessor.java b/core/src/com/cloud/storage/template/IsoProcessor.java
index 271818ccd91..0eba55e8cdc 100644
--- a/core/src/com/cloud/storage/template/IsoProcessor.java
+++ b/core/src/com/cloud/storage/template/IsoProcessor.java
@@ -24,14 +24,15 @@
 
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.storage.Storage.ImageFormat;
 import com.cloud.storage.StorageLayer;
 import com.cloud.utils.component.AdapterBase;
 
 public class IsoProcessor extends AdapterBase implements Processor {
-    private static final Logger s_logger = Logger.getLogger(IsoProcessor.class);
+    private static final Logger s_logger = LogManager.getLogger(IsoProcessor.class);
 
     StorageLayer _storage;
 
diff --git a/core/src/com/cloud/storage/template/LocalTemplateDownloader.java b/core/src/com/cloud/storage/template/LocalTemplateDownloader.java
index 564eba3d5ee..18ee2fbba3d 100644
--- a/core/src/com/cloud/storage/template/LocalTemplateDownloader.java
+++ b/core/src/com/cloud/storage/template/LocalTemplateDownloader.java
@@ -29,12 +29,13 @@
 import java.nio.ByteBuffer;
 import java.nio.channels.FileChannel;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.storage.StorageLayer;
 
 public class LocalTemplateDownloader extends TemplateDownloaderBase implements TemplateDownloader {
-    public static final Logger s_logger = Logger.getLogger(LocalTemplateDownloader.class);
+    public static final Logger s_logger = LogManager.getLogger(LocalTemplateDownloader.class);
 
     public LocalTemplateDownloader(StorageLayer storageLayer, String downloadUrl, String toDir, long maxTemplateSizeInBytes, DownloadCompleteCallback callback) {
         super(storageLayer, downloadUrl, toDir, maxTemplateSizeInBytes, callback);
diff --git a/core/src/com/cloud/storage/template/OVAProcessor.java b/core/src/com/cloud/storage/template/OVAProcessor.java
index 31523b6e4d0..b5bdee03faf 100644
--- a/core/src/com/cloud/storage/template/OVAProcessor.java
+++ b/core/src/com/cloud/storage/template/OVAProcessor.java
@@ -25,7 +25,8 @@
 import javax.naming.ConfigurationException;
 import javax.xml.parsers.DocumentBuilderFactory;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
@@ -36,7 +37,7 @@
 import com.cloud.utils.script.Script;
 
 public class OVAProcessor extends AdapterBase implements Processor {
-    private static final Logger s_logger = Logger.getLogger(OVAProcessor.class);
+    private static final Logger s_logger = LogManager.getLogger(OVAProcessor.class);
 
     StorageLayer _storage;
 
diff --git a/core/src/com/cloud/storage/template/QCOW2Processor.java b/core/src/com/cloud/storage/template/QCOW2Processor.java
index 642d8d3cb7b..b919d956d58 100644
--- a/core/src/com/cloud/storage/template/QCOW2Processor.java
+++ b/core/src/com/cloud/storage/template/QCOW2Processor.java
@@ -27,7 +27,8 @@
 import javax.naming.ConfigurationException;
 
 import com.cloud.exception.InternalErrorException;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.storage.Storage.ImageFormat;
 import com.cloud.storage.StorageLayer;
@@ -35,7 +36,7 @@
 import com.cloud.utils.component.AdapterBase;
 
 public class QCOW2Processor extends AdapterBase implements Processor {
-    private static final Logger s_logger = Logger.getLogger(QCOW2Processor.class);
+    private static final Logger s_logger = LogManager.getLogger(QCOW2Processor.class);
     private static final int VIRTUALSIZE_HEADER_LOCATION = 24;
 
     private StorageLayer _storage;
diff --git a/core/src/com/cloud/storage/template/RawImageProcessor.java b/core/src/com/cloud/storage/template/RawImageProcessor.java
index 5645a3199a7..16fc95d0200 100644
--- a/core/src/com/cloud/storage/template/RawImageProcessor.java
+++ b/core/src/com/cloud/storage/template/RawImageProcessor.java
@@ -24,7 +24,8 @@
 
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.exception.InternalErrorException;
 import com.cloud.storage.Storage.ImageFormat;
@@ -32,7 +33,7 @@
 import com.cloud.utils.component.AdapterBase;
 
 public class RawImageProcessor extends AdapterBase implements Processor {
-    private static final Logger s_logger = Logger.getLogger(RawImageProcessor.class);
+    private static final Logger s_logger = LogManager.getLogger(RawImageProcessor.class);
     StorageLayer _storage;
 
     @Override
diff --git a/core/src/com/cloud/storage/template/S3TemplateDownloader.java b/core/src/com/cloud/storage/template/S3TemplateDownloader.java
index d584cdffb10..cf8fc59c193 100644
--- a/core/src/com/cloud/storage/template/S3TemplateDownloader.java
+++ b/core/src/com/cloud/storage/template/S3TemplateDownloader.java
@@ -38,7 +38,8 @@
 import org.apache.commons.httpclient.methods.GetMethod;
 import org.apache.commons.httpclient.params.HttpMethodParams;
 import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import java.io.BufferedInputStream;
 import java.io.IOException;
@@ -56,7 +57,7 @@
  * Execution of the instance is started when runInContext() is called.
  */
 public class S3TemplateDownloader extends ManagedContextRunnable implements TemplateDownloader {
-    private static final Logger LOGGER = Logger.getLogger(S3TemplateDownloader.class.getName());
+    private static final Logger LOGGER = LogManager.getLogger(S3TemplateDownloader.class.getName());
 
     private final String downloadUrl;
     private final String s3Key;
diff --git a/core/src/com/cloud/storage/template/ScpTemplateDownloader.java b/core/src/com/cloud/storage/template/ScpTemplateDownloader.java
index 912809ca722..f493da0da25 100644
--- a/core/src/com/cloud/storage/template/ScpTemplateDownloader.java
+++ b/core/src/com/cloud/storage/template/ScpTemplateDownloader.java
@@ -23,7 +23,8 @@
 import java.net.URI;
 import java.net.URISyntaxException;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.trilead.ssh2.SCPClient;
 
@@ -31,7 +32,7 @@
 import com.cloud.utils.exception.CloudRuntimeException;
 
 public class ScpTemplateDownloader extends TemplateDownloaderBase implements TemplateDownloader {
-    private static final Logger s_logger = Logger.getLogger(ScpTemplateDownloader.class);
+    private static final Logger s_logger = LogManager.getLogger(ScpTemplateDownloader.class);
 
     public ScpTemplateDownloader(StorageLayer storageLayer, String downloadUrl, String toDir, long maxTemplateSizeInBytes, DownloadCompleteCallback callback) {
         super(storageLayer, downloadUrl, toDir, maxTemplateSizeInBytes, callback);
diff --git a/core/src/com/cloud/storage/template/TARProcessor.java b/core/src/com/cloud/storage/template/TARProcessor.java
index dfd9a0adf25..156d14617b8 100644
--- a/core/src/com/cloud/storage/template/TARProcessor.java
+++ b/core/src/com/cloud/storage/template/TARProcessor.java
@@ -22,14 +22,15 @@
 import com.cloud.storage.Storage.ImageFormat;
 import com.cloud.storage.StorageLayer;
 import com.cloud.utils.component.AdapterBase;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import javax.naming.ConfigurationException;
 import java.io.File;
 import java.util.Map;
 
 public class TARProcessor extends AdapterBase implements Processor {
-    private static final Logger s_logger = Logger.getLogger(TARProcessor.class);
+    private static final Logger s_logger = LogManager.getLogger(TARProcessor.class);
 
     private StorageLayer _storage;
 
diff --git a/core/src/com/cloud/storage/template/TemplateDownloaderBase.java b/core/src/com/cloud/storage/template/TemplateDownloaderBase.java
index f56e4911ca7..545ed30c4ae 100644
--- a/core/src/com/cloud/storage/template/TemplateDownloaderBase.java
+++ b/core/src/com/cloud/storage/template/TemplateDownloaderBase.java
@@ -21,14 +21,15 @@
 
 import java.io.File;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.managed.context.ManagedContextRunnable;
 
 import com.cloud.storage.StorageLayer;
 
 public abstract class TemplateDownloaderBase extends ManagedContextRunnable implements TemplateDownloader {
-    private static final Logger s_logger = Logger.getLogger(TemplateDownloaderBase.class);
+    private static final Logger s_logger = LogManager.getLogger(TemplateDownloaderBase.class);
 
     protected String _downloadUrl;
     protected String _toFile;
diff --git a/core/src/com/cloud/storage/template/TemplateLocation.java b/core/src/com/cloud/storage/template/TemplateLocation.java
index e52a635dc68..6cccb6e0c8c 100644
--- a/core/src/com/cloud/storage/template/TemplateLocation.java
+++ b/core/src/com/cloud/storage/template/TemplateLocation.java
@@ -27,7 +27,8 @@
 import java.util.Iterator;
 import java.util.Properties;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.storage.command.DownloadCommand.ResourceType;
 
@@ -37,7 +38,7 @@
 import com.cloud.utils.NumbersUtil;
 
 public class TemplateLocation {
-    private static final Logger s_logger = Logger.getLogger(TemplateLocation.class);
+    private static final Logger s_logger = LogManager.getLogger(TemplateLocation.class);
     public final static String Filename = "template.properties";
 
     StorageLayer _storage;
diff --git a/core/src/com/cloud/storage/template/VhdProcessor.java b/core/src/com/cloud/storage/template/VhdProcessor.java
index cb13d06687b..c6431c18d3d 100644
--- a/core/src/com/cloud/storage/template/VhdProcessor.java
+++ b/core/src/com/cloud/storage/template/VhdProcessor.java
@@ -27,7 +27,8 @@
 import org.apache.commons.compress.compressors.CompressorException;
 import org.apache.commons.compress.compressors.CompressorInputStream;
 import org.apache.commons.compress.compressors.CompressorStreamFactory;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import javax.naming.ConfigurationException;
 import java.io.BufferedInputStream;
@@ -46,7 +47,7 @@
  */
 public class VhdProcessor extends AdapterBase implements Processor {
 
-    private static final Logger s_logger = Logger.getLogger(VhdProcessor.class);
+    private static final Logger s_logger = LogManager.getLogger(VhdProcessor.class);
     StorageLayer _storage;
     private int vhdFooterSize = 512;
     private int vhdCookieOffset = 8;
diff --git a/core/src/com/cloud/storage/template/VmdkProcessor.java b/core/src/com/cloud/storage/template/VmdkProcessor.java
index eacabb93968..9b0fe1b7c8a 100644
--- a/core/src/com/cloud/storage/template/VmdkProcessor.java
+++ b/core/src/com/cloud/storage/template/VmdkProcessor.java
@@ -30,7 +30,8 @@
 
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.exception.InternalErrorException;
 import com.cloud.storage.Storage.ImageFormat;
@@ -38,7 +39,7 @@
 import com.cloud.utils.component.AdapterBase;
 
 public class VmdkProcessor extends AdapterBase implements Processor {
-    private static final Logger s_logger = Logger.getLogger(VmdkProcessor.class);
+    private static final Logger s_logger = LogManager.getLogger(VmdkProcessor.class);
 
     StorageLayer _storage;
 
diff --git a/core/test/com/cloud/agent/transport/RequestTest.java b/core/test/com/cloud/agent/transport/RequestTest.java
index 21766ba038f..a6018874e84 100644
--- a/core/test/com/cloud/agent/transport/RequestTest.java
+++ b/core/test/com/cloud/agent/transport/RequestTest.java
@@ -21,9 +21,13 @@
 
 import java.nio.ByteBuffer;
 import junit.framework.TestCase;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
 import org.junit.Assert;
 import org.mockito.Mockito;
 
@@ -58,7 +62,7 @@
  */
 
 public class RequestTest extends TestCase {
-    private static final Logger s_logger = Logger.getLogger(RequestTest.class);
+    private static final Logger s_logger = LogManager.getLogger(RequestTest.class);
 
     public void testSerDeser() {
         s_logger.info("Testing serializing and deserializing works as expected");
@@ -74,10 +78,12 @@ public void testSerDeser() {
         Request sreq = new Request(2, 3, new Command[] {cmd1, cmd2, cmd3}, true, true);
         sreq.setSequence(892403717);
 
-        Logger logger = Logger.getLogger(GsonHelper.class);
+        Logger logger = LogManager.getLogger(GsonHelper.class);
         Level level = logger.getLevel();
 
-        logger.setLevel(Level.DEBUG);
+        Map<String,Level> levels = new HashMap<>();
+        levels.put(GsonHelper.class.getName(),Level.DEBUG);
+        org.apache.logging.log4j.core.config.Configurator.setLevel(levels);
         String log = sreq.log("Debug", true, Level.DEBUG);
         assert (log.contains(UpdateHostPasswordCommand.class.getSimpleName()));
         assert (log.contains(SecStorageFirewallCfgCommand.class.getSimpleName()));
@@ -85,7 +91,8 @@ public void testSerDeser() {
         assert (!log.contains("username"));
         assert (!log.contains("password"));
 
-        logger.setLevel(Level.TRACE);
+        levels.put(GsonHelper.class.getName(),Level.TRACE);
+        org.apache.logging.log4j.core.config.Configurator.setLevel(levels);
         log = sreq.log("Trace", true, Level.TRACE);
         assert (log.contains(UpdateHostPasswordCommand.class.getSimpleName()));
         assert (log.contains(SecStorageFirewallCfgCommand.class.getSimpleName()));
@@ -93,11 +100,13 @@ public void testSerDeser() {
         assert (!log.contains("username"));
         assert (!log.contains("password"));
 
-        logger.setLevel(Level.INFO);
+        levels.put(GsonHelper.class.getName(),Level.INFO);
+        org.apache.logging.log4j.core.config.Configurator.setLevel(levels);
         log = sreq.log("Info", true, Level.INFO);
         assert (log == null);
 
-        logger.setLevel(level);
+        levels.put(GsonHelper.class.getName(),level);
+        org.apache.logging.log4j.core.config.Configurator.setLevel(levels);
 
         byte[] bytes = sreq.getBytes();
 
@@ -217,22 +226,26 @@ public void testLogging() {
         GetHostStatsCommand cmd3 = new GetHostStatsCommand("hostguid", "hostname", 101);
         Request sreq = new Request(2, 3, new Command[] {cmd3}, true, true);
         sreq.setSequence(1);
-        Logger logger = Logger.getLogger(GsonHelper.class);
+        Logger logger = LogManager.getLogger(GsonHelper.class);
         Level level = logger.getLevel();
 
-        logger.setLevel(Level.DEBUG);
+        Map<String, Level> levels = new HashMap<>();
+        levels.put(GsonHelper.class.getName(),Level.DEBUG);
+        org.apache.logging.log4j.core.config.Configurator.setLevel(levels);
         String log = sreq.log("Debug", true, Level.DEBUG);
         assert (log == null);
 
         log = sreq.log("Debug", false, Level.DEBUG);
         assert (log != null);
 
-        logger.setLevel(Level.TRACE);
+        levels.put(GsonHelper.class.getName(),Level.TRACE);
+        org.apache.logging.log4j.core.config.Configurator.setLevel(levels);
         log = sreq.log("Trace", true, Level.TRACE);
         assert (log.contains(GetHostStatsCommand.class.getSimpleName()));
         s_logger.debug(log);
 
-        logger.setLevel(level);
+        levels.put(GsonHelper.class.getName(),level);
+        org.apache.logging.log4j.core.config.Configurator.setLevel(levels);
     }
 
     protected void compareRequest(Request req1, Request req2) {
diff --git a/engine/components-api/src/com/cloud/event/UsageEventUtils.java b/engine/components-api/src/com/cloud/event/UsageEventUtils.java
index 69892d60b72..05c116a5732 100644
--- a/engine/components-api/src/com/cloud/event/UsageEventUtils.java
+++ b/engine/components-api/src/com/cloud/event/UsageEventUtils.java
@@ -25,7 +25,8 @@
 import javax.annotation.PostConstruct;
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.beans.factory.NoSuchBeanDefinitionException;
 
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
@@ -45,7 +46,7 @@
     private static UsageEventDao s_usageEventDao;
     private static AccountDao s_accountDao;
     private static DataCenterDao s_dcDao;
-    private static final Logger s_logger = Logger.getLogger(UsageEventUtils.class);
+    private static final Logger s_logger = LogManager.getLogger(UsageEventUtils.class);
     protected static EventBus s_eventBus = null;
     protected static ConfigurationDao s_configDao;
 
diff --git a/engine/components-api/src/com/cloud/network/NetworkStateListener.java b/engine/components-api/src/com/cloud/network/NetworkStateListener.java
index ef8dddc1f23..2f056b0a7dd 100644
--- a/engine/components-api/src/com/cloud/network/NetworkStateListener.java
+++ b/engine/components-api/src/com/cloud/network/NetworkStateListener.java
@@ -27,7 +27,8 @@
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
 import org.apache.cloudstack.framework.events.EventBus;
 import org.apache.cloudstack.framework.events.EventBusException;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.beans.factory.NoSuchBeanDefinitionException;
 
 import com.cloud.event.EventCategory;
@@ -44,7 +45,7 @@
 
     private static EventBus s_eventBus = null;
 
-    private static final Logger s_logger = Logger.getLogger(NetworkStateListener.class);
+    private static final Logger s_logger = LogManager.getLogger(NetworkStateListener.class);
 
     public NetworkStateListener(ConfigurationDao configDao) {
         _configDao = configDao;
diff --git a/engine/components-api/src/com/cloud/vm/VmWorkJobHandlerProxy.java b/engine/components-api/src/com/cloud/vm/VmWorkJobHandlerProxy.java
index ce10a83c7cd..a43531e5c5d 100644
--- a/engine/components-api/src/com/cloud/vm/VmWorkJobHandlerProxy.java
+++ b/engine/components-api/src/com/cloud/vm/VmWorkJobHandlerProxy.java
@@ -21,7 +21,8 @@
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.google.gson.Gson;
 
@@ -40,7 +41,7 @@
  */
 public class VmWorkJobHandlerProxy implements VmWorkJobHandler {
 
-    private static final Logger s_logger = Logger.getLogger(VmWorkJobHandlerProxy.class);
+    private static final Logger s_logger = LogManager.getLogger(VmWorkJobHandlerProxy.class);
 
     private Object _target;
     private Map<Class<?>, Method> _handlerMethodMap = new HashMap<Class<?>, Method>();
diff --git a/engine/orchestration/src/com/cloud/agent/manager/AgentAttache.java b/engine/orchestration/src/com/cloud/agent/manager/AgentAttache.java
index a3838e1e6ef..38ce1af8571 100644
--- a/engine/orchestration/src/com/cloud/agent/manager/AgentAttache.java
+++ b/engine/orchestration/src/com/cloud/agent/manager/AgentAttache.java
@@ -33,7 +33,8 @@
 
 import com.cloud.agent.api.ModifySshKeysCommand;
 import org.apache.cloudstack.managed.context.ManagedContextRunnable;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.agent.Listener;
 import com.cloud.agent.api.Answer;
@@ -65,7 +66,7 @@
  *  AgentAttache provides basic commands to be implemented.
  */
 public abstract class AgentAttache {
-    private static final Logger s_logger = Logger.getLogger(AgentAttache.class);
+    private static final Logger s_logger = LogManager.getLogger(AgentAttache.class);
 
     private static final ScheduledExecutorService s_listenerExecutor = Executors.newScheduledThreadPool(10, new NamedThreadFactory("ListenerTimer"));
     private static final Random s_rand = new Random(System.currentTimeMillis());
diff --git a/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java b/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java
index 325f3ec739f..952fb224c57 100644
--- a/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java
+++ b/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java
@@ -46,8 +46,9 @@
 import org.apache.cloudstack.managed.context.ManagedContextRunnable;
 import org.apache.cloudstack.outofbandmanagement.dao.OutOfBandManagementDao;
 import org.apache.cloudstack.utils.identity.ManagementServerNode;
-import org.apache.log4j.Logger;
-import org.slf4j.MDC;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.ThreadContext;
 
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.Listener;
@@ -120,8 +121,8 @@
  * Implementation of the Agent Manager. This class controls the connection to the agents.
  **/
 public class AgentManagerImpl extends ManagerBase implements AgentManager, HandlerFactory, Configurable {
-    protected static final Logger s_logger = Logger.getLogger(AgentManagerImpl.class);
-    protected static final Logger status_logger = Logger.getLogger(Status.class);
+    protected static final Logger s_logger = LogManager.getLogger(AgentManagerImpl.class);
+    protected static final Logger status_logger = LogManager.getLogger(Status.class);
 
     /**
      * _agents is a ConcurrentHashMap, but it is used from within a synchronized block. This will be reported by findbugs as JLM_JSR166_UTILCONCURRENT_MONITORENTER. Maybe a
@@ -397,8 +398,8 @@ private static void tagCommand(final Command cmd) {
                 cmd.setContextParam("job", "job-" + job.getId());
             }
         }
-        if (MDC.get("logcontextid") != null && !MDC.get("logcontextid").isEmpty()) {
-            cmd.setContextParam("logid", MDC.get("logcontextid"));
+        if (ThreadContext.get("logcontextid") != null && !ThreadContext.get("logcontextid").isEmpty()) {
+            cmd.setContextParam("logid", ThreadContext.get("logcontextid"));
         }
     }
 
diff --git a/engine/orchestration/src/com/cloud/agent/manager/ClusteredAgentAttache.java b/engine/orchestration/src/com/cloud/agent/manager/ClusteredAgentAttache.java
index 306c47ff60c..f659fb92961 100644
--- a/engine/orchestration/src/com/cloud/agent/manager/ClusteredAgentAttache.java
+++ b/engine/orchestration/src/com/cloud/agent/manager/ClusteredAgentAttache.java
@@ -25,7 +25,8 @@
 
 import javax.net.ssl.SSLEngine;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.agent.Listener;
 import com.cloud.agent.api.Command;
@@ -35,7 +36,7 @@
 import com.cloud.utils.nio.Link;
 
 public class ClusteredAgentAttache extends ConnectedAgentAttache implements Routable {
-    private final static Logger s_logger = Logger.getLogger(ClusteredAgentAttache.class);
+    private final static Logger s_logger = LogManager.getLogger(ClusteredAgentAttache.class);
     private static ClusteredAgentManagerImpl s_clusteredAgentMgr;
     protected ByteBuffer _buffer = ByteBuffer.allocate(2048);
     private boolean _forward = false;
diff --git a/engine/orchestration/src/com/cloud/agent/manager/ClusteredAgentManagerImpl.java b/engine/orchestration/src/com/cloud/agent/manager/ClusteredAgentManagerImpl.java
index 2ebfeb5dd67..c4c86dbc54a 100644
--- a/engine/orchestration/src/com/cloud/agent/manager/ClusteredAgentManagerImpl.java
+++ b/engine/orchestration/src/com/cloud/agent/manager/ClusteredAgentManagerImpl.java
@@ -52,7 +52,8 @@
 import org.apache.cloudstack.utils.security.SSLUtils;
 import org.apache.cloudstack.ha.dao.HAConfigDao;
 import org.apache.cloudstack.outofbandmanagement.dao.OutOfBandManagementDao;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.agent.api.Answer;
 import com.cloud.agent.api.CancelCommand;
@@ -97,7 +98,7 @@
 import com.google.gson.Gson;
 
 public class ClusteredAgentManagerImpl extends AgentManagerImpl implements ClusterManagerListener, ClusteredAgentRebalanceService {
-    final static Logger s_logger = Logger.getLogger(ClusteredAgentManagerImpl.class);
+    final static Logger s_logger = LogManager.getLogger(ClusteredAgentManagerImpl.class);
     private static final ScheduledExecutorService s_transferExecutor = Executors.newScheduledThreadPool(2, new NamedThreadFactory("Cluster-AgentRebalancingExecutor"));
     private final long rebalanceTimeOut = 300000; // 5 mins - after this time remove the agent from the transfer list
 
diff --git a/engine/orchestration/src/com/cloud/agent/manager/ConnectedAgentAttache.java b/engine/orchestration/src/com/cloud/agent/manager/ConnectedAgentAttache.java
index f11a105b2a1..7361b68ad7b 100644
--- a/engine/orchestration/src/com/cloud/agent/manager/ConnectedAgentAttache.java
+++ b/engine/orchestration/src/com/cloud/agent/manager/ConnectedAgentAttache.java
@@ -18,7 +18,8 @@
 
 import java.nio.channels.ClosedChannelException;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.agent.transport.Request;
 import com.cloud.exception.AgentUnavailableException;
@@ -29,7 +30,7 @@
  * ConnectedAgentAttache implements an direct connection to this management server.
  */
 public class ConnectedAgentAttache extends AgentAttache {
-    private static final Logger s_logger = Logger.getLogger(ConnectedAgentAttache.class);
+    private static final Logger s_logger = LogManager.getLogger(ConnectedAgentAttache.class);
 
     protected Link _link;
 
diff --git a/engine/orchestration/src/com/cloud/agent/manager/DirectAgentAttache.java b/engine/orchestration/src/com/cloud/agent/manager/DirectAgentAttache.java
index be4d029a000..87c7c784598 100644
--- a/engine/orchestration/src/com/cloud/agent/manager/DirectAgentAttache.java
+++ b/engine/orchestration/src/com/cloud/agent/manager/DirectAgentAttache.java
@@ -23,11 +23,6 @@
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
 
-import org.apache.log4j.Logger;
-import org.apache.cloudstack.framework.config.ConfigKey;
-import org.apache.cloudstack.managed.context.ManagedContextRunnable;
-import org.slf4j.MDC;
-
 import com.cloud.agent.api.Answer;
 import com.cloud.agent.api.Command;
 import com.cloud.agent.api.CronCommand;
@@ -38,9 +33,14 @@
 import com.cloud.exception.AgentUnavailableException;
 import com.cloud.host.Status;
 import com.cloud.resource.ServerResource;
+import org.apache.cloudstack.framework.config.ConfigKey;
+import org.apache.cloudstack.managed.context.ManagedContextRunnable;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.ThreadContext;
 
 public class DirectAgentAttache extends AgentAttache {
-    private final static Logger s_logger = Logger.getLogger(DirectAgentAttache.class);
+    private final static Logger s_logger = LogManager.getLogger(DirectAgentAttache.class);
 
     protected final ConfigKey<Integer> _HostPingRetryCount = new ConfigKey<Integer>("Advanced", Integer.class, "host.ping.retry.count", "0",
             "Number of times retrying a host ping while waiting for check results", true);
@@ -178,7 +178,7 @@ protected synchronized void runInContext() {
                     }
 
                     if (cmd.getContextParam("logid") != null) {
-                        MDC.put("logcontextid", cmd.getContextParam("logid"));
+                        ThreadContext.put("logcontextid", cmd.getContextParam("logid"));
                     }
                     if (s_logger.isDebugEnabled()) {
                         s_logger.debug("Ping from " + _id + "(" + _name + ")");
@@ -246,7 +246,7 @@ protected void runInContext() {
                     Answer answer = null;
                     Command currentCmd = cmds[i];
                     if (currentCmd.getContextParam("logid") != null) {
-                        MDC.put("logcontextid", currentCmd.getContextParam("logid"));
+                        ThreadContext.put("logcontextid", currentCmd.getContextParam("logid"));
                     }
                     try {
                         if (resource != null) {
@@ -308,7 +308,7 @@ protected void runInContext() {
                     Answer answer = null;
                     Command currentCmd = cmds[i];
                     if (currentCmd.getContextParam("logid") != null) {
-                        MDC.put("logcontextid", currentCmd.getContextParam("logid"));
+                        ThreadContext.put("logcontextid", currentCmd.getContextParam("logid"));
                     }
                     try {
                         if (resource != null) {
diff --git a/engine/orchestration/src/com/cloud/agent/manager/SynchronousListener.java b/engine/orchestration/src/com/cloud/agent/manager/SynchronousListener.java
index 96d40777f8e..6c3e8a8dcf5 100644
--- a/engine/orchestration/src/com/cloud/agent/manager/SynchronousListener.java
+++ b/engine/orchestration/src/com/cloud/agent/manager/SynchronousListener.java
@@ -16,7 +16,8 @@
 // under the License.
 package com.cloud.agent.manager;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.agent.Listener;
 import com.cloud.agent.api.AgentControlAnswer;
@@ -29,7 +30,7 @@
 import com.cloud.utils.Profiler;
 
 public class SynchronousListener implements Listener {
-    private static final Logger s_logger = Logger.getLogger(SynchronousListener.class);
+    private static final Logger s_logger = LogManager.getLogger(SynchronousListener.class);
 
     protected Answer[] _answers;
     protected boolean _disconnected;
diff --git a/engine/orchestration/src/com/cloud/cluster/agentlb/ClusterBasedAgentLoadBalancerPlanner.java b/engine/orchestration/src/com/cloud/cluster/agentlb/ClusterBasedAgentLoadBalancerPlanner.java
index c774470b758..9210dadc5d3 100644
--- a/engine/orchestration/src/com/cloud/cluster/agentlb/ClusterBasedAgentLoadBalancerPlanner.java
+++ b/engine/orchestration/src/com/cloud/cluster/agentlb/ClusterBasedAgentLoadBalancerPlanner.java
@@ -26,7 +26,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.host.Host;
@@ -39,7 +40,7 @@
 
 @Component
 public class ClusterBasedAgentLoadBalancerPlanner extends AdapterBase implements AgentLoadBalancerPlanner {
-    private static final Logger s_logger = Logger.getLogger(AgentLoadBalancerPlanner.class);
+    private static final Logger s_logger = LogManager.getLogger(AgentLoadBalancerPlanner.class);
 
     @Inject
     HostDao _hostDao = null;
diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
index f684cbfe881..36b799aabba 100755
--- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
+++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
@@ -69,7 +69,8 @@
 import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
 import org.apache.cloudstack.storage.to.VolumeObjectTO;
 import org.apache.cloudstack.utils.identity.ManagementServerNode;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.Listener;
@@ -213,7 +214,7 @@
 import com.google.common.base.Strings;
 
 public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMachineManager, VmWorkJobHandler, Listener, Configurable {
-    private static final Logger s_logger = Logger.getLogger(VirtualMachineManagerImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(VirtualMachineManagerImpl.class);
 
     public static final String VM_WORK_JOB_HANDLER = VirtualMachineManagerImpl.class.getSimpleName();
 
diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachinePowerStateSyncImpl.java b/engine/orchestration/src/com/cloud/vm/VirtualMachinePowerStateSyncImpl.java
index 3b9d6f596de..46824ef09c8 100644
--- a/engine/orchestration/src/com/cloud/vm/VirtualMachinePowerStateSyncImpl.java
+++ b/engine/orchestration/src/com/cloud/vm/VirtualMachinePowerStateSyncImpl.java
@@ -23,7 +23,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.apache.cloudstack.framework.config.ConfigKey;
 import org.apache.cloudstack.framework.messagebus.MessageBus;
 import org.apache.cloudstack.framework.messagebus.PublishScope;
@@ -34,7 +35,7 @@
 import com.cloud.vm.dao.VMInstanceDao;
 
 public class VirtualMachinePowerStateSyncImpl implements VirtualMachinePowerStateSync {
-    private static final Logger s_logger = Logger.getLogger(VirtualMachinePowerStateSyncImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(VirtualMachinePowerStateSyncImpl.class);
 
     @Inject MessageBus _messageBus;
     @Inject VMInstanceDao _instanceDao;
diff --git a/engine/orchestration/src/com/cloud/vm/VmWorkJobDispatcher.java b/engine/orchestration/src/com/cloud/vm/VmWorkJobDispatcher.java
index 9f1eca67022..74c36202336 100644
--- a/engine/orchestration/src/com/cloud/vm/VmWorkJobDispatcher.java
+++ b/engine/orchestration/src/com/cloud/vm/VmWorkJobDispatcher.java
@@ -20,7 +20,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.context.CallContext;
 import org.apache.cloudstack.framework.jobs.AsyncJob;
@@ -34,7 +35,7 @@
 import com.cloud.vm.dao.VMInstanceDao;
 
 public class VmWorkJobDispatcher extends AdapterBase implements AsyncJobDispatcher {
-    private static final Logger s_logger = Logger.getLogger(VmWorkJobDispatcher.class);
+    private static final Logger s_logger = LogManager.getLogger(VmWorkJobDispatcher.class);
 
     @Inject private VirtualMachineManagerImpl _vmMgr;
     @Inject
diff --git a/engine/orchestration/src/com/cloud/vm/VmWorkJobWakeupDispatcher.java b/engine/orchestration/src/com/cloud/vm/VmWorkJobWakeupDispatcher.java
index 520a55042e3..b6a38db664b 100644
--- a/engine/orchestration/src/com/cloud/vm/VmWorkJobWakeupDispatcher.java
+++ b/engine/orchestration/src/com/cloud/vm/VmWorkJobWakeupDispatcher.java
@@ -24,7 +24,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.context.CallContext;
 import org.apache.cloudstack.framework.jobs.AsyncJob;
@@ -47,7 +48,7 @@
  * Current code base uses blocking calls to wait for job completion
  */
 public class VmWorkJobWakeupDispatcher extends AdapterBase implements AsyncJobDispatcher {
-    private static final Logger s_logger = Logger.getLogger(VmWorkJobWakeupDispatcher.class);
+    private static final Logger s_logger = LogManager.getLogger(VmWorkJobWakeupDispatcher.class);
 
     @Inject
     private VmWorkJobDao _workjobDao;
diff --git a/engine/orchestration/src/com/cloud/vm/VmWorkStart.java b/engine/orchestration/src/com/cloud/vm/VmWorkStart.java
index 814e78c2830..d7bab1f8875 100644
--- a/engine/orchestration/src/com/cloud/vm/VmWorkStart.java
+++ b/engine/orchestration/src/com/cloud/vm/VmWorkStart.java
@@ -23,7 +23,8 @@
 
 import org.apache.cloudstack.context.CallContext;
 import org.apache.cloudstack.framework.jobs.impl.JobSerializerHelper;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.deploy.DataCenterDeployment;
 import com.cloud.deploy.DeploymentPlan;
@@ -33,7 +34,7 @@
 public class VmWorkStart extends VmWork {
     private static final long serialVersionUID = 9038937399817468894L;
 
-    private static final Logger s_logger = Logger.getLogger(VmWorkStart.class);
+    private static final Logger s_logger = LogManager.getLogger(VmWorkStart.class);
 
     long dcId;
     Long podId;
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManagerImpl.java b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManagerImpl.java
index ef9c44ab26d..335c6f8f5f1 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManagerImpl.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManagerImpl.java
@@ -29,7 +29,8 @@
 import org.apache.cloudstack.engine.cloud.entity.api.db.dao.VMReservationDao;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager;
 import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.dc.DataCenter;
@@ -67,7 +68,7 @@
 @Component
 public class VMEntityManagerImpl implements VMEntityManager {
 
-    private static final Logger s_logger = Logger.getLogger(VMEntityManagerImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(VMEntityManagerImpl.class);
 
     @Inject
     protected VMInstanceDao _vmDao;
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineClusterDaoImpl.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineClusterDaoImpl.java
index 10c75d56db0..9bf118adddb 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineClusterDaoImpl.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineClusterDaoImpl.java
@@ -27,7 +27,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity;
@@ -51,7 +52,7 @@
 
 @Component(value = "EngineClusterDao")
 public class EngineClusterDaoImpl extends GenericDaoBase<EngineClusterVO, Long> implements EngineClusterDao {
-    private static final Logger s_logger = Logger.getLogger(EngineClusterDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(EngineClusterDaoImpl.class);
 
     protected final SearchBuilder<EngineClusterVO> PodSearch;
     protected final SearchBuilder<EngineClusterVO> HyTypeWithoutGuidSearch;
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineDataCenterDaoImpl.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineDataCenterDaoImpl.java
index a0d484c6193..c342032acae 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineDataCenterDaoImpl.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineDataCenterDaoImpl.java
@@ -25,7 +25,8 @@
 import javax.naming.ConfigurationException;
 import javax.persistence.TableGenerator;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity;
@@ -53,7 +54,7 @@
  **/
 @Component(value = "EngineDataCenterDao")
 public class EngineDataCenterDaoImpl extends GenericDaoBase<EngineDataCenterVO, Long> implements EngineDataCenterDao {
-    private static final Logger s_logger = Logger.getLogger(EngineDataCenterDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(EngineDataCenterDaoImpl.class);
 
     protected SearchBuilder<EngineDataCenterVO> NameSearch;
     protected SearchBuilder<EngineDataCenterVO> ListZonesByDomainIdSearch;
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineHostDaoImpl.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineHostDaoImpl.java
index 819bd32146e..73959c2b14b 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineHostDaoImpl.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineHostDaoImpl.java
@@ -25,7 +25,8 @@
 import javax.inject.Inject;
 import javax.persistence.TableGenerator;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity;
@@ -54,7 +55,7 @@
 @DB
 @TableGenerator(name = "host_req_sq", table = "op_host", pkColumnName = "id", valueColumnName = "sequence", allocationSize = 1)
 public class EngineHostDaoImpl extends GenericDaoBase<EngineHostVO, Long> implements EngineHostDao {
-    private static final Logger s_logger = Logger.getLogger(EngineHostDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(EngineHostDaoImpl.class);
 
     private final SearchBuilder<EngineHostVO> TypePodDcStatusSearch;
 
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineHostPodDaoImpl.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineHostPodDaoImpl.java
index 1eb0857a61d..25ce31c0692 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineHostPodDaoImpl.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineHostPodDaoImpl.java
@@ -25,7 +25,8 @@
 import java.util.List;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity;
@@ -44,7 +45,7 @@
 
 @Component(value = "EngineHostPodDao")
 public class EngineHostPodDaoImpl extends GenericDaoBase<EngineHostPodVO, Long> implements EngineHostPodDao {
-    private static final Logger s_logger = Logger.getLogger(EngineHostPodDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(EngineHostPodDaoImpl.class);
 
     protected SearchBuilder<EngineHostPodVO> DataCenterAndNameSearch;
     protected SearchBuilder<EngineHostPodVO> DataCenterIdSearch;
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
index 755fba2f74c..d3b45b1e474 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
@@ -36,6 +36,16 @@
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
+import com.cloud.network.dao.NetworkDetailsDao;
+import com.cloud.network.dao.RemoteAccessVpnDao;
+import com.cloud.network.dao.RemoteAccessVpnVO;
+import com.cloud.network.dao.VpnUserDao;
+import com.cloud.network.element.RedundantResource;
+import com.cloud.network.router.VirtualRouter;
+import com.cloud.vm.DomainRouterVO;
+import com.cloud.vm.dao.DomainRouterDao;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.apache.cloudstack.acl.ControlledEntity.ACLType;
 import org.apache.cloudstack.context.CallContext;
 import org.apache.cloudstack.engine.cloud.entity.api.db.VMNetworkMapVO;
@@ -50,7 +60,6 @@
 import org.apache.cloudstack.framework.messagebus.PublishScope;
 import org.apache.cloudstack.managed.context.ManagedContextRunnable;
 import org.apache.cloudstack.region.PortableIpDao;
-import org.apache.log4j.Logger;
 
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.Listener;
@@ -123,7 +132,6 @@
 import com.cloud.network.dao.NetworkAccountDao;
 import com.cloud.network.dao.NetworkAccountVO;
 import com.cloud.network.dao.NetworkDao;
-import com.cloud.network.dao.NetworkDetailsDao;
 import com.cloud.network.dao.NetworkDomainDao;
 import com.cloud.network.dao.NetworkDomainVO;
 import com.cloud.network.dao.NetworkServiceMapDao;
@@ -134,22 +142,17 @@
 import com.cloud.network.dao.PhysicalNetworkTrafficTypeDao;
 import com.cloud.network.dao.PhysicalNetworkTrafficTypeVO;
 import com.cloud.network.dao.PhysicalNetworkVO;
-import com.cloud.network.dao.RemoteAccessVpnDao;
-import com.cloud.network.dao.RemoteAccessVpnVO;
-import com.cloud.network.dao.VpnUserDao;
 import com.cloud.network.element.AggregatedCommandExecutor;
 import com.cloud.network.element.DhcpServiceProvider;
 import com.cloud.network.element.DnsServiceProvider;
 import com.cloud.network.element.IpDeployer;
 import com.cloud.network.element.LoadBalancingServiceProvider;
 import com.cloud.network.element.NetworkElement;
-import com.cloud.network.element.RedundantResource;
 import com.cloud.network.element.StaticNatServiceProvider;
 import com.cloud.network.element.UserDataServiceProvider;
 import com.cloud.network.guru.NetworkGuru;
 import com.cloud.network.guru.NetworkGuruAdditionalFunctions;
 import com.cloud.network.lb.LoadBalancingRulesManager;
-import com.cloud.network.router.VirtualRouter;
 import com.cloud.network.rules.FirewallManager;
 import com.cloud.network.rules.FirewallRule;
 import com.cloud.network.rules.FirewallRule.Purpose;
@@ -197,7 +200,6 @@
 import com.cloud.utils.fsm.NoTransitionException;
 import com.cloud.utils.fsm.StateMachine2;
 import com.cloud.utils.net.NetUtils;
-import com.cloud.vm.DomainRouterVO;
 import com.cloud.vm.Nic;
 import com.cloud.vm.Nic.ReservationStrategy;
 import com.cloud.vm.NicIpAlias;
@@ -210,7 +212,6 @@
 import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.VirtualMachine.Type;
 import com.cloud.vm.VirtualMachineProfile;
-import com.cloud.vm.dao.DomainRouterDao;
 import com.cloud.vm.dao.NicDao;
 import com.cloud.vm.dao.NicIpAliasDao;
 import com.cloud.vm.dao.NicIpAliasVO;
@@ -224,7 +225,7 @@
  * NetworkManagerImpl implements NetworkManager.
  */
 public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestrationService, Listener, Configurable {
-    static final Logger s_logger = Logger.getLogger(NetworkOrchestrator.class);
+    static final Logger s_logger = LogManager.getLogger(NetworkOrchestrator.class);
 
     @Inject
     EntityManager _entityMgr;
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
index 7669b3b98a9..6a9df6d7746 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
@@ -30,7 +30,8 @@
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.engine.orchestration.service.VolumeOrchestrationService;
 import org.apache.cloudstack.engine.subsystem.api.storage.ChapInfo;
@@ -143,7 +144,7 @@
         full, linked
     }
 
-    private static final Logger s_logger = Logger.getLogger(VolumeOrchestrator.class);
+    private static final Logger s_logger = LogManager.getLogger(VolumeOrchestrator.class);
 
     @Inject
     EntityManager _entityMgr;
diff --git a/engine/orchestration/test/org/apache/cloudstack/engine/orchestration/NetworkOrchestratorTest.java b/engine/orchestration/test/org/apache/cloudstack/engine/orchestration/NetworkOrchestratorTest.java
index 2d15403a865..c621ac6f768 100644
--- a/engine/orchestration/test/org/apache/cloudstack/engine/orchestration/NetworkOrchestratorTest.java
+++ b/engine/orchestration/test/org/apache/cloudstack/engine/orchestration/NetworkOrchestratorTest.java
@@ -27,7 +27,8 @@
 import java.util.List;
 import java.util.Map;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Matchers;
@@ -57,7 +58,7 @@
  * NetworkManagerImpl implements NetworkManager.
  */
 public class NetworkOrchestratorTest extends TestCase {
-    static final Logger s_logger = Logger.getLogger(NetworkOrchestratorTest.class);
+    static final Logger s_logger = LogManager.getLogger(NetworkOrchestratorTest.class);
 
     NetworkOrchestrator testOrchastrator = new NetworkOrchestrator();
 
diff --git a/engine/schema/src/com/cloud/capacity/dao/CapacityDaoImpl.java b/engine/schema/src/com/cloud/capacity/dao/CapacityDaoImpl.java
index 5b14bd4af3b..97b77937aa2 100644
--- a/engine/schema/src/com/cloud/capacity/dao/CapacityDaoImpl.java
+++ b/engine/schema/src/com/cloud/capacity/dao/CapacityDaoImpl.java
@@ -26,7 +26,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
@@ -49,7 +50,7 @@
 
 @Component
 public class CapacityDaoImpl extends GenericDaoBase<CapacityVO, Long> implements CapacityDao {
-    private static final Logger s_logger = Logger.getLogger(CapacityDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(CapacityDaoImpl.class);
 
     private static final String ADD_ALLOCATED_SQL = "UPDATE `cloud`.`op_host_capacity` SET used_capacity = used_capacity + ? WHERE host_id = ? AND capacity_type = ?";
     private static final String SUBTRACT_ALLOCATED_SQL =
diff --git a/engine/schema/src/com/cloud/certificate/dao/CertificateDaoImpl.java b/engine/schema/src/com/cloud/certificate/dao/CertificateDaoImpl.java
index 9544804284e..e4f33ab7b27 100644
--- a/engine/schema/src/com/cloud/certificate/dao/CertificateDaoImpl.java
+++ b/engine/schema/src/com/cloud/certificate/dao/CertificateDaoImpl.java
@@ -17,7 +17,8 @@
 package com.cloud.certificate.dao;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.certificate.CertificateVO;
@@ -28,7 +29,7 @@
 @DB
 public class CertificateDaoImpl extends GenericDaoBase<CertificateVO, Long> implements CertificateDao {
 
-    private static final Logger s_logger = Logger.getLogger(CertificateDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(CertificateDaoImpl.class);
 
     public CertificateDaoImpl() {
 
diff --git a/engine/schema/src/com/cloud/cluster/agentlb/dao/HostTransferMapDaoImpl.java b/engine/schema/src/com/cloud/cluster/agentlb/dao/HostTransferMapDaoImpl.java
index e1c0dbd9e47..950213616f4 100644
--- a/engine/schema/src/com/cloud/cluster/agentlb/dao/HostTransferMapDaoImpl.java
+++ b/engine/schema/src/com/cloud/cluster/agentlb/dao/HostTransferMapDaoImpl.java
@@ -21,7 +21,8 @@
 
 import javax.annotation.PostConstruct;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.cluster.agentlb.HostTransferMapVO;
@@ -34,7 +35,7 @@
 @Component
 @DB
 public class HostTransferMapDaoImpl extends GenericDaoBase<HostTransferMapVO, Long> implements HostTransferMapDao {
-    private static final Logger s_logger = Logger.getLogger(HostTransferMapDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(HostTransferMapDaoImpl.class);
 
     protected SearchBuilder<HostTransferMapVO> AllFieldsSearch;
     protected SearchBuilder<HostTransferMapVO> IntermediateStateSearch;
diff --git a/engine/schema/src/com/cloud/dc/dao/DataCenterDaoImpl.java b/engine/schema/src/com/cloud/dc/dao/DataCenterDaoImpl.java
index 847a24730fc..6810269d71e 100644
--- a/engine/schema/src/com/cloud/dc/dao/DataCenterDaoImpl.java
+++ b/engine/schema/src/com/cloud/dc/dao/DataCenterDaoImpl.java
@@ -25,7 +25,8 @@
 import javax.naming.ConfigurationException;
 import javax.persistence.TableGenerator;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.dc.DataCenterDetailVO;
@@ -56,7 +57,7 @@
  **/
 @Component
 public class DataCenterDaoImpl extends GenericDaoBase<DataCenterVO, Long> implements DataCenterDao {
-    private static final Logger s_logger = Logger.getLogger(DataCenterDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(DataCenterDaoImpl.class);
 
     protected SearchBuilder<DataCenterVO> NameSearch;
     protected SearchBuilder<DataCenterVO> ListZonesByDomainIdSearch;
diff --git a/engine/schema/src/com/cloud/dc/dao/DataCenterIpAddressDaoImpl.java b/engine/schema/src/com/cloud/dc/dao/DataCenterIpAddressDaoImpl.java
index e840a4d91b0..cb64b47128a 100644
--- a/engine/schema/src/com/cloud/dc/dao/DataCenterIpAddressDaoImpl.java
+++ b/engine/schema/src/com/cloud/dc/dao/DataCenterIpAddressDaoImpl.java
@@ -22,7 +22,8 @@
 import java.util.List;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.dc.DataCenterIpAddressVO;
@@ -39,7 +40,7 @@
 @Component
 @DB
 public class DataCenterIpAddressDaoImpl extends GenericDaoBase<DataCenterIpAddressVO, Long> implements DataCenterIpAddressDao {
-    private static final Logger s_logger = Logger.getLogger(DataCenterIpAddressDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(DataCenterIpAddressDaoImpl.class);
 
     private final SearchBuilder<DataCenterIpAddressVO> AllFieldsSearch;
     private final GenericSearchBuilder<DataCenterIpAddressVO, Integer> AllIpCount;
diff --git a/engine/schema/src/com/cloud/dc/dao/DataCenterLinkLocalIpAddressDaoImpl.java b/engine/schema/src/com/cloud/dc/dao/DataCenterLinkLocalIpAddressDaoImpl.java
index 4fa3ad75ab5..be98e5b16a0 100644
--- a/engine/schema/src/com/cloud/dc/dao/DataCenterLinkLocalIpAddressDaoImpl.java
+++ b/engine/schema/src/com/cloud/dc/dao/DataCenterLinkLocalIpAddressDaoImpl.java
@@ -24,7 +24,8 @@
 
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.dc.DataCenterLinkLocalIpAddressVO;
@@ -41,7 +42,7 @@
 @Component
 @DB
 public class DataCenterLinkLocalIpAddressDaoImpl extends GenericDaoBase<DataCenterLinkLocalIpAddressVO, Long> implements DataCenterLinkLocalIpAddressDao {
-    private static final Logger s_logger = Logger.getLogger(DataCenterLinkLocalIpAddressDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(DataCenterLinkLocalIpAddressDaoImpl.class);
 
     private final SearchBuilder<DataCenterLinkLocalIpAddressVO> AllFieldsSearch;
     private final GenericSearchBuilder<DataCenterLinkLocalIpAddressVO, Integer> AllIpCount;
diff --git a/engine/schema/src/com/cloud/dc/dao/HostPodDaoImpl.java b/engine/schema/src/com/cloud/dc/dao/HostPodDaoImpl.java
index 3fbeb58c56f..23bce0f328a 100644
--- a/engine/schema/src/com/cloud/dc/dao/HostPodDaoImpl.java
+++ b/engine/schema/src/com/cloud/dc/dao/HostPodDaoImpl.java
@@ -24,7 +24,8 @@
 import java.util.List;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.dc.HostPodVO;
@@ -38,7 +39,7 @@
 
 @Component
 public class HostPodDaoImpl extends GenericDaoBase<HostPodVO, Long> implements HostPodDao {
-    private static final Logger s_logger = Logger.getLogger(HostPodDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(HostPodDaoImpl.class);
 
     protected SearchBuilder<HostPodVO> DataCenterAndNameSearch;
     protected SearchBuilder<HostPodVO> DataCenterIdSearch;
diff --git a/engine/schema/src/com/cloud/domain/DomainVO.java b/engine/schema/src/com/cloud/domain/DomainVO.java
index 34376c7d019..bf05a761384 100644
--- a/engine/schema/src/com/cloud/domain/DomainVO.java
+++ b/engine/schema/src/com/cloud/domain/DomainVO.java
@@ -26,14 +26,15 @@
 import javax.persistence.Id;
 import javax.persistence.Table;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.utils.db.GenericDao;
 
 @Entity
 @Table(name = "domain")
 public class DomainVO implements Domain {
-    public static final Logger s_logger = Logger.getLogger(DomainVO.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DomainVO.class.getName());
 
     @Id
     @GeneratedValue(strategy = GenerationType.IDENTITY)
diff --git a/engine/schema/src/com/cloud/domain/dao/DomainDaoImpl.java b/engine/schema/src/com/cloud/domain/dao/DomainDaoImpl.java
index 4316e3bc8ed..37d32ff181e 100644
--- a/engine/schema/src/com/cloud/domain/dao/DomainDaoImpl.java
+++ b/engine/schema/src/com/cloud/domain/dao/DomainDaoImpl.java
@@ -24,7 +24,8 @@
 import java.util.Set;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.domain.Domain;
@@ -38,7 +39,7 @@
 
 @Component
 public class DomainDaoImpl extends GenericDaoBase<DomainVO, Long> implements DomainDao {
-    private static final Logger s_logger = Logger.getLogger(DomainDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(DomainDaoImpl.class);
 
     protected SearchBuilder<DomainVO> DomainNameLikeSearch;
     protected SearchBuilder<DomainVO> ParentDomainNameLikeSearch;
diff --git a/engine/schema/src/com/cloud/event/dao/EventDaoImpl.java b/engine/schema/src/com/cloud/event/dao/EventDaoImpl.java
index d4627904f0b..3eca51b66de 100644
--- a/engine/schema/src/com/cloud/event/dao/EventDaoImpl.java
+++ b/engine/schema/src/com/cloud/event/dao/EventDaoImpl.java
@@ -20,7 +20,8 @@
 import java.util.List;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.event.Event.State;
@@ -34,7 +35,7 @@
 
 @Component
 public class EventDaoImpl extends GenericDaoBase<EventVO, Long> implements EventDao {
-    public static final Logger s_logger = Logger.getLogger(EventDaoImpl.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(EventDaoImpl.class.getName());
     protected final SearchBuilder<EventVO> CompletedEventSearch;
     protected final SearchBuilder<EventVO> ToArchiveOrDeleteEventSearch;
 
diff --git a/engine/schema/src/com/cloud/event/dao/UsageEventDaoImpl.java b/engine/schema/src/com/cloud/event/dao/UsageEventDaoImpl.java
index 519b2ecfe73..99dc75785b3 100644
--- a/engine/schema/src/com/cloud/event/dao/UsageEventDaoImpl.java
+++ b/engine/schema/src/com/cloud/event/dao/UsageEventDaoImpl.java
@@ -25,7 +25,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.dc.Vlan;
@@ -42,7 +43,7 @@
 
 @Component
 public class UsageEventDaoImpl extends GenericDaoBase<UsageEventVO, Long> implements UsageEventDao {
-    public static final Logger s_logger = Logger.getLogger(UsageEventDaoImpl.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UsageEventDaoImpl.class.getName());
 
     private final SearchBuilder<UsageEventVO> latestEventsSearch;
     private final SearchBuilder<UsageEventVO> IpeventsSearch;
diff --git a/engine/schema/src/com/cloud/event/dao/UsageEventDetailsDaoImpl.java b/engine/schema/src/com/cloud/event/dao/UsageEventDetailsDaoImpl.java
index 43e00efc1ad..6381a727e0c 100644
--- a/engine/schema/src/com/cloud/event/dao/UsageEventDetailsDaoImpl.java
+++ b/engine/schema/src/com/cloud/event/dao/UsageEventDetailsDaoImpl.java
@@ -20,7 +20,8 @@
 import java.util.Map;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.event.UsageEventDetailsVO;
@@ -31,7 +32,7 @@
 
 @Component
 public class UsageEventDetailsDaoImpl extends GenericDaoBase<UsageEventDetailsVO, Long> implements UsageEventDetailsDao {
-    public static final Logger s_logger = Logger.getLogger(UsageEventDetailsDaoImpl.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UsageEventDetailsDaoImpl.class.getName());
 
     protected final SearchBuilder<UsageEventDetailsVO> EventDetailsSearch;
     protected final SearchBuilder<UsageEventDetailsVO> DetailSearch;
diff --git a/engine/schema/src/com/cloud/gpu/dao/HostGpuGroupsDaoImpl.java b/engine/schema/src/com/cloud/gpu/dao/HostGpuGroupsDaoImpl.java
index 25f8d245a3b..e9db22232e0 100644
--- a/engine/schema/src/com/cloud/gpu/dao/HostGpuGroupsDaoImpl.java
+++ b/engine/schema/src/com/cloud/gpu/dao/HostGpuGroupsDaoImpl.java
@@ -19,7 +19,8 @@
 import java.util.List;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.gpu.HostGpuGroupsVO;
@@ -30,7 +31,7 @@
 
 @Component
 public class HostGpuGroupsDaoImpl extends GenericDaoBase<HostGpuGroupsVO, Long> implements HostGpuGroupsDao {
-    private static final Logger s_logger = Logger.getLogger(HostGpuGroupsDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(HostGpuGroupsDaoImpl.class);
 
     private final SearchBuilder<HostGpuGroupsVO> _hostIdGroupNameSearch;
     private final SearchBuilder<HostGpuGroupsVO> _searchByHostId;
diff --git a/engine/schema/src/com/cloud/gpu/dao/VGPUTypesDaoImpl.java b/engine/schema/src/com/cloud/gpu/dao/VGPUTypesDaoImpl.java
index d4e31d365d9..9c44fc10323 100644
--- a/engine/schema/src/com/cloud/gpu/dao/VGPUTypesDaoImpl.java
+++ b/engine/schema/src/com/cloud/gpu/dao/VGPUTypesDaoImpl.java
@@ -27,7 +27,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.agent.api.VgpuTypesInfo;
@@ -41,7 +42,7 @@
 
 @Component
 public class VGPUTypesDaoImpl extends GenericDaoBase<VGPUTypesVO, Long> implements VGPUTypesDao {
-    private static final Logger s_logger = Logger.getLogger(VGPUTypesDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(VGPUTypesDaoImpl.class);
 
     private final SearchBuilder<VGPUTypesVO> _searchByGroupId;
     private final SearchBuilder<VGPUTypesVO> _searchByGroupIdVGPUType;
diff --git a/engine/schema/src/com/cloud/host/dao/HostDaoImpl.java b/engine/schema/src/com/cloud/host/dao/HostDaoImpl.java
index d08b40281e6..c25715c5488 100644
--- a/engine/schema/src/com/cloud/host/dao/HostDaoImpl.java
+++ b/engine/schema/src/com/cloud/host/dao/HostDaoImpl.java
@@ -33,7 +33,8 @@
 
 import com.cloud.utils.NumbersUtil;
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.agent.api.VgpuTypesInfo;
@@ -75,9 +76,9 @@
 @DB
 @TableGenerator(name = "host_req_sq", table = "op_host", pkColumnName = "id", valueColumnName = "sequence", allocationSize = 1)
 public class HostDaoImpl extends GenericDaoBase<HostVO, Long> implements HostDao { //FIXME: , ExternalIdDao {
-    private static final Logger s_logger = Logger.getLogger(HostDaoImpl.class);
-    private static final Logger status_logger = Logger.getLogger(Status.class);
-    private static final Logger state_logger = Logger.getLogger(ResourceState.class);
+    private static final Logger s_logger = LogManager.getLogger(HostDaoImpl.class);
+    private static final Logger status_logger = LogManager.getLogger(Status.class);
+    private static final Logger state_logger = LogManager.getLogger(ResourceState.class);
 
     private static final String LIST_CLUSTERID_FOR_HOST_TAG = "select distinct cluster_id from host join host_tags on host.id = host_tags.host_id and host_tags.tag = ?";
 
diff --git a/engine/schema/src/com/cloud/hypervisor/dao/HypervisorCapabilitiesDaoImpl.java b/engine/schema/src/com/cloud/hypervisor/dao/HypervisorCapabilitiesDaoImpl.java
index b4d2f6f785f..087b8a97cc0 100644
--- a/engine/schema/src/com/cloud/hypervisor/dao/HypervisorCapabilitiesDaoImpl.java
+++ b/engine/schema/src/com/cloud/hypervisor/dao/HypervisorCapabilitiesDaoImpl.java
@@ -19,7 +19,8 @@
 import java.util.List;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
@@ -31,7 +32,7 @@
 @Component
 public class HypervisorCapabilitiesDaoImpl extends GenericDaoBase<HypervisorCapabilitiesVO, Long> implements HypervisorCapabilitiesDao {
 
-    private static final Logger s_logger = Logger.getLogger(HypervisorCapabilitiesDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(HypervisorCapabilitiesDaoImpl.class);
 
     protected final SearchBuilder<HypervisorCapabilitiesVO> HypervisorTypeSearch;
     protected final SearchBuilder<HypervisorCapabilitiesVO> HypervisorTypeAndVersionSearch;
diff --git a/engine/schema/src/com/cloud/network/dao/FirewallRulesCidrsDaoImpl.java b/engine/schema/src/com/cloud/network/dao/FirewallRulesCidrsDaoImpl.java
index f6185309972..827dd1da584 100644
--- a/engine/schema/src/com/cloud/network/dao/FirewallRulesCidrsDaoImpl.java
+++ b/engine/schema/src/com/cloud/network/dao/FirewallRulesCidrsDaoImpl.java
@@ -20,7 +20,8 @@
 import java.util.List;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.utils.db.DB;
@@ -31,7 +32,7 @@
 
 @Component
 public class FirewallRulesCidrsDaoImpl extends GenericDaoBase<FirewallRulesCidrsVO, Long> implements FirewallRulesCidrsDao {
-    private static final Logger s_logger = Logger.getLogger(FirewallRulesCidrsDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(FirewallRulesCidrsDaoImpl.class);
     protected final SearchBuilder<FirewallRulesCidrsVO> CidrsSearch;
 
     protected FirewallRulesCidrsDaoImpl() {
diff --git a/engine/schema/src/com/cloud/network/dao/IPAddressDaoImpl.java b/engine/schema/src/com/cloud/network/dao/IPAddressDaoImpl.java
index 43345b916fe..3d02d5c604b 100644
--- a/engine/schema/src/com/cloud/network/dao/IPAddressDaoImpl.java
+++ b/engine/schema/src/com/cloud/network/dao/IPAddressDaoImpl.java
@@ -25,7 +25,8 @@
 import javax.inject.Inject;
 
 import org.apache.cloudstack.resourcedetail.dao.UserIpAddressDetailsDao;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.dc.Vlan.VlanType;
@@ -48,7 +49,7 @@
 @Component
 @DB
 public class IPAddressDaoImpl extends GenericDaoBase<IPAddressVO, Long> implements IPAddressDao {
-    private static final Logger s_logger = Logger.getLogger(IPAddressDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(IPAddressDaoImpl.class);
 
     protected SearchBuilder<IPAddressVO> AllFieldsSearch;
     protected SearchBuilder<IPAddressVO> VlanDbIdSearchUnallocated;
diff --git a/engine/schema/src/com/cloud/network/dao/PortProfileDaoImpl.java b/engine/schema/src/com/cloud/network/dao/PortProfileDaoImpl.java
index 40d5c8eba0f..811522eba12 100644
--- a/engine/schema/src/com/cloud/network/dao/PortProfileDaoImpl.java
+++ b/engine/schema/src/com/cloud/network/dao/PortProfileDaoImpl.java
@@ -22,7 +22,8 @@
 import java.util.List;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.utils.db.DB;
@@ -36,7 +37,7 @@
 @Component
 @DB()
 public class PortProfileDaoImpl extends GenericDaoBase<PortProfileVO, Long> implements PortProfileDao {
-    protected static final Logger s_logger = Logger.getLogger(PortProfileDaoImpl.class);
+    protected static final Logger s_logger = LogManager.getLogger(PortProfileDaoImpl.class);
 
     final SearchBuilder<PortProfileVO> nameSearch;
     final SearchBuilder<PortProfileVO> accessVlanSearch;
diff --git a/engine/schema/src/com/cloud/network/dao/RemoteAccessVpnDaoImpl.java b/engine/schema/src/com/cloud/network/dao/RemoteAccessVpnDaoImpl.java
index 3aa2e749712..8bbefc4236c 100644
--- a/engine/schema/src/com/cloud/network/dao/RemoteAccessVpnDaoImpl.java
+++ b/engine/schema/src/com/cloud/network/dao/RemoteAccessVpnDaoImpl.java
@@ -19,7 +19,8 @@
 import java.util.List;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.network.RemoteAccessVpn;
@@ -29,7 +30,7 @@
 
 @Component
 public class RemoteAccessVpnDaoImpl extends GenericDaoBase<RemoteAccessVpnVO, Long> implements RemoteAccessVpnDao {
-    private static final Logger s_logger = Logger.getLogger(RemoteAccessVpnDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(RemoteAccessVpnDaoImpl.class);
 
     private final SearchBuilder<RemoteAccessVpnVO> AllFieldsSearch;
 
diff --git a/engine/schema/src/com/cloud/network/dao/Site2SiteCustomerGatewayDaoImpl.java b/engine/schema/src/com/cloud/network/dao/Site2SiteCustomerGatewayDaoImpl.java
index 4db826b6459..4731871f27d 100644
--- a/engine/schema/src/com/cloud/network/dao/Site2SiteCustomerGatewayDaoImpl.java
+++ b/engine/schema/src/com/cloud/network/dao/Site2SiteCustomerGatewayDaoImpl.java
@@ -19,7 +19,8 @@
 import java.util.List;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.utils.db.GenericDaoBase;
@@ -28,7 +29,7 @@
 
 @Component
 public class Site2SiteCustomerGatewayDaoImpl extends GenericDaoBase<Site2SiteCustomerGatewayVO, Long> implements Site2SiteCustomerGatewayDao {
-    private static final Logger s_logger = Logger.getLogger(Site2SiteCustomerGatewayDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(Site2SiteCustomerGatewayDaoImpl.class);
 
     private final SearchBuilder<Site2SiteCustomerGatewayVO> AllFieldsSearch;
 
diff --git a/engine/schema/src/com/cloud/network/dao/Site2SiteVpnConnectionDaoImpl.java b/engine/schema/src/com/cloud/network/dao/Site2SiteVpnConnectionDaoImpl.java
index b55f39ab31b..7d29ab7daed 100644
--- a/engine/schema/src/com/cloud/network/dao/Site2SiteVpnConnectionDaoImpl.java
+++ b/engine/schema/src/com/cloud/network/dao/Site2SiteVpnConnectionDaoImpl.java
@@ -21,7 +21,8 @@
 import javax.annotation.PostConstruct;
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.utils.db.GenericDaoBase;
@@ -31,7 +32,7 @@
 
 @Component
 public class Site2SiteVpnConnectionDaoImpl extends GenericDaoBase<Site2SiteVpnConnectionVO, Long> implements Site2SiteVpnConnectionDao {
-    private static final Logger s_logger = Logger.getLogger(Site2SiteVpnConnectionDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(Site2SiteVpnConnectionDaoImpl.class);
 
     @Inject
     protected IPAddressDao _addrDao;
diff --git a/engine/schema/src/com/cloud/network/dao/Site2SiteVpnGatewayDaoImpl.java b/engine/schema/src/com/cloud/network/dao/Site2SiteVpnGatewayDaoImpl.java
index 80465f9ee1e..3eb06cea6fc 100644
--- a/engine/schema/src/com/cloud/network/dao/Site2SiteVpnGatewayDaoImpl.java
+++ b/engine/schema/src/com/cloud/network/dao/Site2SiteVpnGatewayDaoImpl.java
@@ -18,7 +18,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.utils.db.GenericDaoBase;
@@ -30,7 +31,7 @@
     @Inject
     protected IPAddressDao _addrDao;
 
-    private static final Logger s_logger = Logger.getLogger(Site2SiteVpnGatewayDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(Site2SiteVpnGatewayDaoImpl.class);
 
     private final SearchBuilder<Site2SiteVpnGatewayVO> AllFieldsSearch;
 
diff --git a/engine/schema/src/com/cloud/network/dao/UserIpv6AddressDaoImpl.java b/engine/schema/src/com/cloud/network/dao/UserIpv6AddressDaoImpl.java
index 9a7737fe12c..5b9f6ce0ee6 100644
--- a/engine/schema/src/com/cloud/network/dao/UserIpv6AddressDaoImpl.java
+++ b/engine/schema/src/com/cloud/network/dao/UserIpv6AddressDaoImpl.java
@@ -19,7 +19,8 @@
 import java.util.List;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.network.UserIpv6AddressVO;
@@ -32,7 +33,7 @@
 
 @Component
 public class UserIpv6AddressDaoImpl extends GenericDaoBase<UserIpv6AddressVO, Long> implements UserIpv6AddressDao {
-    private static final Logger s_logger = Logger.getLogger(IPAddressDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(IPAddressDaoImpl.class);
 
     protected final SearchBuilder<UserIpv6AddressVO> AllFieldsSearch;
     protected GenericSearchBuilder<UserIpv6AddressVO, Long> CountFreePublicIps;
diff --git a/engine/schema/src/com/cloud/network/security/dao/SecurityGroupWorkDaoImpl.java b/engine/schema/src/com/cloud/network/security/dao/SecurityGroupWorkDaoImpl.java
index 9b0bf088a14..53773fb8a99 100644
--- a/engine/schema/src/com/cloud/network/security/dao/SecurityGroupWorkDaoImpl.java
+++ b/engine/schema/src/com/cloud/network/security/dao/SecurityGroupWorkDaoImpl.java
@@ -20,7 +20,8 @@
 import java.util.List;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.network.security.SecurityGroupWork;
@@ -37,7 +38,7 @@
 
 @Component
 public class SecurityGroupWorkDaoImpl extends GenericDaoBase<SecurityGroupWorkVO, Long> implements SecurityGroupWorkDao {
-    private static final Logger s_logger = Logger.getLogger(SecurityGroupWorkDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(SecurityGroupWorkDaoImpl.class);
 
     private final SearchBuilder<SecurityGroupWorkVO> VmIdTakenSearch;
     private final SearchBuilder<SecurityGroupWorkVO> VmIdSeqNumSearch;
diff --git a/engine/schema/src/com/cloud/network/security/dao/VmRulesetLogDaoImpl.java b/engine/schema/src/com/cloud/network/security/dao/VmRulesetLogDaoImpl.java
index 7620b15b930..408c4eab915 100644
--- a/engine/schema/src/com/cloud/network/security/dao/VmRulesetLogDaoImpl.java
+++ b/engine/schema/src/com/cloud/network/security/dao/VmRulesetLogDaoImpl.java
@@ -26,7 +26,8 @@
 import java.util.Set;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.network.security.VmRulesetLogVO;
@@ -37,7 +38,7 @@
 
 @Component
 public class VmRulesetLogDaoImpl extends GenericDaoBase<VmRulesetLogVO, Long> implements VmRulesetLogDao {
-    protected static final Logger s_logger = Logger.getLogger(VmRulesetLogDaoImpl.class);
+    protected static final Logger s_logger = LogManager.getLogger(VmRulesetLogDaoImpl.class);
     private SearchBuilder<VmRulesetLogVO> VmIdSearch;
     private String InsertOrUpdateSQl = "INSERT INTO op_vm_ruleset_log (instance_id, created, logsequence) "
         + " VALUES(?, now(), 1) ON DUPLICATE KEY UPDATE logsequence=logsequence+1";
diff --git a/engine/schema/src/com/cloud/network/vpc/dao/NetworkACLItemCidrsDaoImpl.java b/engine/schema/src/com/cloud/network/vpc/dao/NetworkACLItemCidrsDaoImpl.java
index 395c9b20f80..80a78621a8c 100644
--- a/engine/schema/src/com/cloud/network/vpc/dao/NetworkACLItemCidrsDaoImpl.java
+++ b/engine/schema/src/com/cloud/network/vpc/dao/NetworkACLItemCidrsDaoImpl.java
@@ -22,7 +22,8 @@
 import java.util.List;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.network.vpc.NetworkACLItemCidrsDao;
@@ -38,7 +39,7 @@
  */
 @Component
 public class NetworkACLItemCidrsDaoImpl extends GenericDaoBase<NetworkACLItemCidrsVO, Long> implements NetworkACLItemCidrsDao {
-    private static final Logger s_logger = Logger.getLogger(NetworkACLItemCidrsDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(NetworkACLItemCidrsDaoImpl.class);
     protected final SearchBuilder<NetworkACLItemCidrsVO> cidrsSearch;
 
     protected NetworkACLItemCidrsDaoImpl() {
diff --git a/engine/schema/src/com/cloud/network/vpc/dao/NetworkACLItemDaoImpl.java b/engine/schema/src/com/cloud/network/vpc/dao/NetworkACLItemDaoImpl.java
index eb957a944ba..db8a6f06995 100644
--- a/engine/schema/src/com/cloud/network/vpc/dao/NetworkACLItemDaoImpl.java
+++ b/engine/schema/src/com/cloud/network/vpc/dao/NetworkACLItemDaoImpl.java
@@ -21,7 +21,8 @@
 import javax.inject.Inject;
 
 import com.google.common.collect.Lists;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.network.vpc.NetworkACLItem.State;
@@ -39,7 +40,7 @@
 @Component
 @DB()
 public class NetworkACLItemDaoImpl extends GenericDaoBase<NetworkACLItemVO, Long> implements NetworkACLItemDao {
-    private static final Logger s_logger = Logger.getLogger(NetworkACLItemDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(NetworkACLItemDaoImpl.class);
 
     protected final SearchBuilder<NetworkACLItemVO> AllFieldsSearch;
     protected final SearchBuilder<NetworkACLItemVO> NotRevokedSearch;
diff --git a/engine/schema/src/com/cloud/network/vpc/dao/PrivateIpDaoImpl.java b/engine/schema/src/com/cloud/network/vpc/dao/PrivateIpDaoImpl.java
index 8b090fdfbc8..d3a869250b9 100644
--- a/engine/schema/src/com/cloud/network/vpc/dao/PrivateIpDaoImpl.java
+++ b/engine/schema/src/com/cloud/network/vpc/dao/PrivateIpDaoImpl.java
@@ -20,7 +20,8 @@
 import java.util.List;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.network.vpc.PrivateIpVO;
@@ -36,7 +37,7 @@
 @Component
 @DB()
 public class PrivateIpDaoImpl extends GenericDaoBase<PrivateIpVO, Long> implements PrivateIpDao {
-    private static final Logger s_logger = Logger.getLogger(PrivateIpDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(PrivateIpDaoImpl.class);
 
     private final SearchBuilder<PrivateIpVO> AllFieldsSearch;
     private final GenericSearchBuilder<PrivateIpVO, Integer> CountAllocatedByNetworkId;
diff --git a/engine/schema/src/com/cloud/projects/dao/ProjectAccountDaoImpl.java b/engine/schema/src/com/cloud/projects/dao/ProjectAccountDaoImpl.java
index ecf1aab6f4f..3c658ccacf2 100644
--- a/engine/schema/src/com/cloud/projects/dao/ProjectAccountDaoImpl.java
+++ b/engine/schema/src/com/cloud/projects/dao/ProjectAccountDaoImpl.java
@@ -19,7 +19,8 @@
 import java.util.List;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.projects.ProjectAccount;
@@ -37,7 +38,7 @@
     final GenericSearchBuilder<ProjectAccountVO, Long> AdminSearch;
     final GenericSearchBuilder<ProjectAccountVO, Long> ProjectAccountSearch;
     final GenericSearchBuilder<ProjectAccountVO, Long> CountByRoleSearch;
-    public static final Logger s_logger = Logger.getLogger(ProjectAccountDaoImpl.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ProjectAccountDaoImpl.class.getName());
 
     protected ProjectAccountDaoImpl() {
         AllFieldsSearch = createSearchBuilder();
diff --git a/engine/schema/src/com/cloud/projects/dao/ProjectDaoImpl.java b/engine/schema/src/com/cloud/projects/dao/ProjectDaoImpl.java
index 560f8dc79fd..94fe22fc253 100644
--- a/engine/schema/src/com/cloud/projects/dao/ProjectDaoImpl.java
+++ b/engine/schema/src/com/cloud/projects/dao/ProjectDaoImpl.java
@@ -20,7 +20,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.projects.Project;
@@ -37,7 +38,7 @@
 
 @Component
 public class ProjectDaoImpl extends GenericDaoBase<ProjectVO, Long> implements ProjectDao {
-    private static final Logger s_logger = Logger.getLogger(ProjectDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(ProjectDaoImpl.class);
     protected final SearchBuilder<ProjectVO> AllFieldsSearch;
     protected GenericSearchBuilder<ProjectVO, Long> CountByDomain;
     protected GenericSearchBuilder<ProjectVO, Long> ProjectAccountSearch;
diff --git a/engine/schema/src/com/cloud/projects/dao/ProjectInvitationDaoImpl.java b/engine/schema/src/com/cloud/projects/dao/ProjectInvitationDaoImpl.java
index 2fc74b9ee85..ce392c37cc5 100644
--- a/engine/schema/src/com/cloud/projects/dao/ProjectInvitationDaoImpl.java
+++ b/engine/schema/src/com/cloud/projects/dao/ProjectInvitationDaoImpl.java
@@ -20,7 +20,8 @@
 import java.util.List;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.projects.ProjectInvitation.State;
@@ -32,7 +33,7 @@
 
 @Component
 public class ProjectInvitationDaoImpl extends GenericDaoBase<ProjectInvitationVO, Long> implements ProjectInvitationDao {
-    private static final Logger s_logger = Logger.getLogger(ProjectInvitationDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(ProjectInvitationDaoImpl.class);
     protected final SearchBuilder<ProjectInvitationVO> AllFieldsSearch;
     protected final SearchBuilder<ProjectInvitationVO> InactiveSearch;
 
diff --git a/engine/schema/src/com/cloud/service/dao/ServiceOfferingDaoImpl.java b/engine/schema/src/com/cloud/service/dao/ServiceOfferingDaoImpl.java
index f54c55863ca..b11313b30c1 100644
--- a/engine/schema/src/com/cloud/service/dao/ServiceOfferingDaoImpl.java
+++ b/engine/schema/src/com/cloud/service/dao/ServiceOfferingDaoImpl.java
@@ -24,7 +24,8 @@
 import javax.inject.Inject;
 import javax.persistence.EntityExistsException;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.event.UsageEventVO;
@@ -42,7 +43,7 @@
 @Component
 @DB()
 public class ServiceOfferingDaoImpl extends GenericDaoBase<ServiceOfferingVO, Long> implements ServiceOfferingDao {
-    protected static final Logger s_logger = Logger.getLogger(ServiceOfferingDaoImpl.class);
+    protected static final Logger s_logger = LogManager.getLogger(ServiceOfferingDaoImpl.class);
 
     @Inject
     protected ServiceOfferingDetailsDao detailsDao;
diff --git a/engine/schema/src/com/cloud/storage/dao/LaunchPermissionDaoImpl.java b/engine/schema/src/com/cloud/storage/dao/LaunchPermissionDaoImpl.java
index ec1a3a267c6..5e0470d20e2 100644
--- a/engine/schema/src/com/cloud/storage/dao/LaunchPermissionDaoImpl.java
+++ b/engine/schema/src/com/cloud/storage/dao/LaunchPermissionDaoImpl.java
@@ -23,7 +23,8 @@
 import java.util.List;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.storage.LaunchPermissionVO;
@@ -39,7 +40,7 @@
 
 @Component
 public class LaunchPermissionDaoImpl extends GenericDaoBase<LaunchPermissionVO, Long> implements LaunchPermissionDao {
-    private static final Logger s_logger = Logger.getLogger(LaunchPermissionDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(LaunchPermissionDaoImpl.class);
     private static final String REMOVE_LAUNCH_PERMISSION = "DELETE FROM `cloud`.`launch_permission`" + "  WHERE template_id = ? AND account_id = ?";
 
     private static final String LIST_PERMITTED_TEMPLATES =
diff --git a/engine/schema/src/com/cloud/storage/dao/SnapshotDaoImpl.java b/engine/schema/src/com/cloud/storage/dao/SnapshotDaoImpl.java
index a6941cf5165..25abb0b4017 100755
--- a/engine/schema/src/com/cloud/storage/dao/SnapshotDaoImpl.java
+++ b/engine/schema/src/com/cloud/storage/dao/SnapshotDaoImpl.java
@@ -23,7 +23,8 @@
 import javax.annotation.PostConstruct;
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.server.ResourceTag.ResourceObjectType;
@@ -51,7 +52,7 @@
 
 @Component
 public class SnapshotDaoImpl extends GenericDaoBase<SnapshotVO, Long> implements SnapshotDao {
-    public static final Logger s_logger = Logger.getLogger(SnapshotDaoImpl.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(SnapshotDaoImpl.class.getName());
     // TODO: we should remove these direct sqls
     private static final String GET_LAST_SNAPSHOT =
         "SELECT snapshots.id FROM snapshot_store_ref, snapshots where snapshots.id = snapshot_store_ref.snapshot_id AND snapshosts.volume_id = ? AND snapshot_store_ref.role = ? ORDER BY created DESC";
diff --git a/engine/schema/src/com/cloud/storage/dao/StoragePoolHostDaoImpl.java b/engine/schema/src/com/cloud/storage/dao/StoragePoolHostDaoImpl.java
index 2b7b0f7cbe4..1cf3565b376 100644
--- a/engine/schema/src/com/cloud/storage/dao/StoragePoolHostDaoImpl.java
+++ b/engine/schema/src/com/cloud/storage/dao/StoragePoolHostDaoImpl.java
@@ -23,7 +23,8 @@
 import java.util.List;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.host.Status;
@@ -36,7 +37,7 @@
 
 @Component
 public class StoragePoolHostDaoImpl extends GenericDaoBase<StoragePoolHostVO, Long> implements StoragePoolHostDao {
-    public static final Logger s_logger = Logger.getLogger(StoragePoolHostDaoImpl.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(StoragePoolHostDaoImpl.class.getName());
 
     protected final SearchBuilder<StoragePoolHostVO> PoolSearch;
     protected final SearchBuilder<StoragePoolHostVO> HostSearch;
diff --git a/engine/schema/src/com/cloud/storage/dao/UploadDaoImpl.java b/engine/schema/src/com/cloud/storage/dao/UploadDaoImpl.java
index 068e1ee91a2..790173b2083 100644
--- a/engine/schema/src/com/cloud/storage/dao/UploadDaoImpl.java
+++ b/engine/schema/src/com/cloud/storage/dao/UploadDaoImpl.java
@@ -19,7 +19,8 @@
 import java.util.List;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.storage.Upload.Mode;
@@ -31,7 +32,7 @@
 
 @Component
 public class UploadDaoImpl extends GenericDaoBase<UploadVO, Long> implements UploadDao {
-    public static final Logger s_logger = Logger.getLogger(UploadDaoImpl.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UploadDaoImpl.class.getName());
     protected final SearchBuilder<UploadVO> typeUploadStatusSearch;
     protected final SearchBuilder<UploadVO> typeHostAndUploadStatusSearch;
     protected final SearchBuilder<UploadVO> typeModeAndStatusSearch;
diff --git a/engine/schema/src/com/cloud/storage/dao/VMTemplateDaoImpl.java b/engine/schema/src/com/cloud/storage/dao/VMTemplateDaoImpl.java
index 2037b3d35f7..1b4fad758d1 100644
--- a/engine/schema/src/com/cloud/storage/dao/VMTemplateDaoImpl.java
+++ b/engine/schema/src/com/cloud/storage/dao/VMTemplateDaoImpl.java
@@ -29,7 +29,8 @@
 
 import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreDao;
 import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreVO;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.dc.dao.DataCenterDao;
@@ -63,7 +64,7 @@
 
 @Component
 public class VMTemplateDaoImpl extends GenericDaoBase<VMTemplateVO, Long> implements VMTemplateDao {
-    private static final Logger s_logger = Logger.getLogger(VMTemplateDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(VMTemplateDaoImpl.class);
 
     @Inject
     VMTemplateZoneDao _templateZoneDao;
diff --git a/engine/schema/src/com/cloud/storage/dao/VMTemplateHostDaoImpl.java b/engine/schema/src/com/cloud/storage/dao/VMTemplateHostDaoImpl.java
index 5f7a2d78e2c..0c4f3c7b6eb 100644
--- a/engine/schema/src/com/cloud/storage/dao/VMTemplateHostDaoImpl.java
+++ b/engine/schema/src/com/cloud/storage/dao/VMTemplateHostDaoImpl.java
@@ -28,7 +28,8 @@
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectInStore;
@@ -51,7 +52,7 @@
 
 @Component
 public class VMTemplateHostDaoImpl extends GenericDaoBase<VMTemplateHostVO, Long> implements VMTemplateHostDao {
-    public static final Logger s_logger = Logger.getLogger(VMTemplateHostDaoImpl.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(VMTemplateHostDaoImpl.class.getName());
     @Inject
     HostDao _hostDao;
     protected final SearchBuilder<VMTemplateHostVO> HostSearch;
diff --git a/engine/schema/src/com/cloud/storage/dao/VMTemplatePoolDaoImpl.java b/engine/schema/src/com/cloud/storage/dao/VMTemplatePoolDaoImpl.java
index 93aad153371..e0c08109743 100644
--- a/engine/schema/src/com/cloud/storage/dao/VMTemplatePoolDaoImpl.java
+++ b/engine/schema/src/com/cloud/storage/dao/VMTemplatePoolDaoImpl.java
@@ -23,7 +23,8 @@
 import java.util.List;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectInStore;
@@ -42,7 +43,7 @@
 
 @Component
 public class VMTemplatePoolDaoImpl extends GenericDaoBase<VMTemplateStoragePoolVO, Long> implements VMTemplatePoolDao {
-    public static final Logger s_logger = Logger.getLogger(VMTemplatePoolDaoImpl.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(VMTemplatePoolDaoImpl.class.getName());
 
     protected final SearchBuilder<VMTemplateStoragePoolVO> PoolSearch;
     protected final SearchBuilder<VMTemplateStoragePoolVO> TemplateSearch;
diff --git a/engine/schema/src/com/cloud/storage/dao/VMTemplateZoneDaoImpl.java b/engine/schema/src/com/cloud/storage/dao/VMTemplateZoneDaoImpl.java
index bffe2098641..3f8cd6922d3 100644
--- a/engine/schema/src/com/cloud/storage/dao/VMTemplateZoneDaoImpl.java
+++ b/engine/schema/src/com/cloud/storage/dao/VMTemplateZoneDaoImpl.java
@@ -19,7 +19,8 @@
 import java.util.List;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.storage.VMTemplateZoneVO;
@@ -30,7 +31,7 @@
 
 @Component
 public class VMTemplateZoneDaoImpl extends GenericDaoBase<VMTemplateZoneVO, Long> implements VMTemplateZoneDao {
-    public static final Logger s_logger = Logger.getLogger(VMTemplateZoneDaoImpl.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(VMTemplateZoneDaoImpl.class.getName());
 
     protected final SearchBuilder<VMTemplateZoneVO> ZoneSearch;
     protected final SearchBuilder<VMTemplateZoneVO> TemplateSearch;
diff --git a/engine/schema/src/com/cloud/storage/dao/VolumeDaoImpl.java b/engine/schema/src/com/cloud/storage/dao/VolumeDaoImpl.java
index f691e30c743..b8de71b0d35 100644
--- a/engine/schema/src/com/cloud/storage/dao/VolumeDaoImpl.java
+++ b/engine/schema/src/com/cloud/storage/dao/VolumeDaoImpl.java
@@ -25,7 +25,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.exception.InvalidParameterValueException;
@@ -53,7 +54,7 @@
 
 @Component
 public class VolumeDaoImpl extends GenericDaoBase<VolumeVO, Long> implements VolumeDao {
-    private static final Logger s_logger = Logger.getLogger(VolumeDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(VolumeDaoImpl.class);
     protected final SearchBuilder<VolumeVO> DetachedAccountIdSearch;
     protected final SearchBuilder<VolumeVO> TemplateZoneSearch;
     protected final GenericSearchBuilder<VolumeVO, SumCount> TotalSizeByPoolSearch;
diff --git a/engine/schema/src/com/cloud/storage/dao/VolumeHostDaoImpl.java b/engine/schema/src/com/cloud/storage/dao/VolumeHostDaoImpl.java
index ce2251300a2..6966f484bcb 100644
--- a/engine/schema/src/com/cloud/storage/dao/VolumeHostDaoImpl.java
+++ b/engine/schema/src/com/cloud/storage/dao/VolumeHostDaoImpl.java
@@ -20,7 +20,8 @@
 import java.util.List;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectInStore;
@@ -36,7 +37,7 @@
 
 @Component
 public class VolumeHostDaoImpl extends GenericDaoBase<VolumeHostVO, Long> implements VolumeHostDao {
-    private static final Logger s_logger = Logger.getLogger(VolumeHostDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(VolumeHostDaoImpl.class);
     protected final SearchBuilder<VolumeHostVO> HostVolumeSearch;
     protected final SearchBuilder<VolumeHostVO> ZoneVolumeSearch;
     protected final SearchBuilder<VolumeHostVO> VolumeSearch;
diff --git a/engine/schema/src/com/cloud/upgrade/DatabaseIntegrityChecker.java b/engine/schema/src/com/cloud/upgrade/DatabaseIntegrityChecker.java
index 6111fb16cf2..d7362fca4d0 100644
--- a/engine/schema/src/com/cloud/upgrade/DatabaseIntegrityChecker.java
+++ b/engine/schema/src/com/cloud/upgrade/DatabaseIntegrityChecker.java
@@ -23,7 +23,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.maint.Version;
@@ -37,7 +38,7 @@
 
 @Component
 public class DatabaseIntegrityChecker extends AdapterBase implements SystemIntegrityChecker {
-    private static final Logger s_logger = Logger.getLogger(DatabaseIntegrityChecker.class);
+    private static final Logger s_logger = LogManager.getLogger(DatabaseIntegrityChecker.class);
 
     @Inject
     VersionDao _dao;
diff --git a/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java b/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java
index fe211154065..4de346ca8f2 100644
--- a/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java
+++ b/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java
@@ -82,7 +82,8 @@
 import com.google.common.collect.ImmutableList;
 import org.apache.cloudstack.utils.CloudStackVersion;
 import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import javax.inject.Inject;
 import java.io.File;
@@ -104,7 +105,7 @@
 import static java.util.Collections.sort;
 
 public class DatabaseUpgradeChecker implements SystemIntegrityChecker {
-    private static final Logger s_logger = Logger.getLogger(DatabaseUpgradeChecker.class);
+    private static final Logger s_logger = LogManager.getLogger(DatabaseUpgradeChecker.class);
     private final ImmutableList<CloudStackVersion> availableVersions;
     protected Map<CloudStackVersion, DbUpgrade[]> _upgradeMap = new HashMap<>();
 
diff --git a/engine/schema/src/com/cloud/upgrade/dao/DatabaseAccessObject.java b/engine/schema/src/com/cloud/upgrade/dao/DatabaseAccessObject.java
index 5d0edddb02e..45d0dc0a02d 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/DatabaseAccessObject.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/DatabaseAccessObject.java
@@ -20,11 +20,12 @@
 import java.sql.PreparedStatement;
 import java.sql.SQLException;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class DatabaseAccessObject {
 
-    private static Logger s_logger = Logger.getLogger(DatabaseAccessObject.class);
+    private static Logger s_logger = LogManager.getLogger(DatabaseAccessObject.class);
 
     public void dropKey(Connection conn, String tableName, String key, boolean isForeignKey)
     {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/LegacyDbUpgrade.java b/engine/schema/src/com/cloud/upgrade/dao/LegacyDbUpgrade.java
index e43f1eb35cd..6b1ef9cae75 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/LegacyDbUpgrade.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/LegacyDbUpgrade.java
@@ -16,11 +16,12 @@
 // under the License.
 package com.cloud.upgrade.dao;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public abstract class LegacyDbUpgrade implements DbUpgrade{
 
-    final static Logger s_logger = Logger.getLogger(LegacyDbUpgrade.class);
+    final static Logger s_logger = LogManager.getLogger(LegacyDbUpgrade.class);
 
     public LegacyDbUpgrade() {
         super();
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade218to22.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade218to22.java
index dd9ff5e39af..49946445619 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade218to22.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade218to22.java
@@ -34,7 +34,8 @@
 import java.util.TimeZone;
 import java.util.UUID;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.configuration.Resource.ResourceType;
 import com.cloud.event.EventTypes;
@@ -47,7 +48,7 @@
 import com.cloud.utils.script.Script;
 
 public class Upgrade218to22 implements DbUpgrade {
-    final static Logger s_logger = Logger.getLogger(Upgrade218to22.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade218to22.class);
     boolean _basicZone;
 
     @Override
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade218to224DomainVlans.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade218to224DomainVlans.java
index dfdd11da659..d0149552d0a 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade218to224DomainVlans.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade218to224DomainVlans.java
@@ -23,12 +23,13 @@
 import java.sql.SQLException;
 import java.util.HashMap;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.utils.exception.CloudRuntimeException;
 
 public class Upgrade218to224DomainVlans implements DbUpgrade {
-    final static Logger s_logger = Logger.getLogger(Upgrade218to224DomainVlans.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade218to224DomainVlans.class);
 
     @Override
     public File[] getPrepareScripts() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade2210to2211.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade2210to2211.java
index 221a25fea7d..47016820200 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade2210to2211.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade2210to2211.java
@@ -19,13 +19,14 @@
 import java.io.File;
 import java.sql.Connection;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.Script;
 
 public class Upgrade2210to2211 implements DbUpgrade {
-    final static Logger s_logger = Logger.getLogger(Upgrade2210to2211.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade2210to2211.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade2211to2212.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade2211to2212.java
index 4a2ba17a2ac..12d47fcc688 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade2211to2212.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade2211to2212.java
@@ -24,13 +24,14 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.Script;
 
 public class Upgrade2211to2212 implements DbUpgrade {
-    final static Logger s_logger = Logger.getLogger(Upgrade2211to2212.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade2211to2212.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade2211to2212Premium.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade2211to2212Premium.java
index 117fa63d008..8672e3e074c 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade2211to2212Premium.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade2211to2212Premium.java
@@ -19,13 +19,14 @@
 import java.io.File;
 import java.sql.Connection;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.Script;
 
 public class Upgrade2211to2212Premium extends Upgrade2211to2212 {
-    final static Logger s_logger = Logger.getLogger(Upgrade2211to2212Premium.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade2211to2212Premium.class);
 
     @Override
     public File[] getPrepareScripts() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade2212to2213.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade2212to2213.java
index df93519371a..bfc3f173608 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade2212to2213.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade2212to2213.java
@@ -24,13 +24,14 @@
 import java.util.HashMap;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.Script;
 
 public class Upgrade2212to2213 implements DbUpgrade {
-    final static Logger s_logger = Logger.getLogger(Upgrade2212to2213.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade2212to2213.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade2213to2214.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade2213to2214.java
index a8bf80c45a9..807e31043ae 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade2213to2214.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade2213to2214.java
@@ -23,13 +23,14 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.Script;
 
 public class Upgrade2213to2214 implements DbUpgrade {
-    final static Logger s_logger = Logger.getLogger(Upgrade2213to2214.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade2213to2214.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade2214to30.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade2214to30.java
index 272d25990d6..3f3188412c1 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade2214to30.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade2214to30.java
@@ -29,7 +29,8 @@
 import java.util.Map;
 import java.util.UUID;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.offering.NetworkOffering;
 import com.cloud.utils.crypt.DBEncryptionUtil;
@@ -39,7 +40,7 @@
 import com.cloud.utils.script.Script;
 
 public class Upgrade2214to30 extends Upgrade30xBase implements DbUpgrade {
-    final static Logger s_logger = Logger.getLogger(Upgrade2214to30.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade2214to30.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade221to222Premium.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade221to222Premium.java
index f1e15685399..d12b42f8e79 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade221to222Premium.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade221to222Premium.java
@@ -19,13 +19,14 @@
 import java.io.File;
 import java.sql.Connection;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.Script;
 
 public class Upgrade221to222Premium extends Upgrade221to222 {
-    final static Logger s_logger = Logger.getLogger(Upgrade221to222Premium.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade221to222Premium.class);
 
     @Override
     public File[] getPrepareScripts() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade222to224.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade222to224.java
index 458f7eebf41..d8e3395ee40 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade222to224.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade222to224.java
@@ -25,14 +25,15 @@
 import java.util.HashMap;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.capacity.Capacity;
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.Script;
 
 public class Upgrade222to224 implements DbUpgrade {
-    final static Logger s_logger = Logger.getLogger(Upgrade222to224.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade222to224.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade222to224Premium.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade222to224Premium.java
index 775c140efdc..4fa0b8d63b6 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade222to224Premium.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade222to224Premium.java
@@ -20,13 +20,14 @@
 import java.sql.Connection;
 import java.sql.PreparedStatement;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.Script;
 
 public class Upgrade222to224Premium extends Upgrade222to224 {
-    final static Logger s_logger = Logger.getLogger(Upgrade222to224Premium.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade222to224Premium.class);
 
     @Override
     public File[] getPrepareScripts() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade224to225.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade224to225.java
index 7b06d7f6b2b..2dec0472196 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade224to225.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade224to225.java
@@ -25,13 +25,14 @@
 import java.util.HashMap;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.Script;
 
 public class Upgrade224to225 implements DbUpgrade {
-    final static Logger s_logger = Logger.getLogger(Upgrade224to225.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade224to225.class);
 
     @Override
     public File[] getPrepareScripts() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade225to226.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade225to226.java
index ed185623e64..0572146b652 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade225to226.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade225to226.java
@@ -22,13 +22,14 @@
 import java.util.HashMap;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.Script;
 
 public class Upgrade225to226 implements DbUpgrade {
-    final static Logger s_logger = Logger.getLogger(Upgrade225to226.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade225to226.class);
 
     @Override
     public File[] getPrepareScripts() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade227to228.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade227to228.java
index fd75857aade..bf699a82938 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade227to228.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade227to228.java
@@ -23,13 +23,14 @@
 import java.sql.SQLException;
 import java.util.ArrayList;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.Script;
 
 public class Upgrade227to228 implements DbUpgrade {
-    final static Logger s_logger = Logger.getLogger(Upgrade227to228.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade227to228.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade227to228Premium.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade227to228Premium.java
index 5ed055125a8..b64b60a190c 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade227to228Premium.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade227to228Premium.java
@@ -22,13 +22,14 @@
 import java.sql.ResultSet;
 import java.sql.SQLException;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.Script;
 
 public class Upgrade227to228Premium extends Upgrade227to228 {
-    final static Logger s_logger = Logger.getLogger(Upgrade227to228Premium.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade227to228Premium.class);
 
     @Override
     public File[] getPrepareScripts() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade228to229.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade228to229.java
index a7757c1981a..2c02868218d 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade228to229.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade228to229.java
@@ -24,13 +24,14 @@
 import java.util.HashMap;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.Script;
 
 public class Upgrade228to229 implements DbUpgrade {
-    final static Logger s_logger = Logger.getLogger(Upgrade228to229.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade228to229.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade229to2210.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade229to2210.java
index dbeb31e6b45..f523a14d4c9 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade229to2210.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade229to2210.java
@@ -23,13 +23,14 @@
 import java.sql.SQLException;
 import java.util.UUID;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.Script;
 
 public class Upgrade229to2210 implements DbUpgrade {
-    final static Logger s_logger = Logger.getLogger(Upgrade229to2210.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade229to2210.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade301to302.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade301to302.java
index 0e9b479c947..6db4e66abd2 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade301to302.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade301to302.java
@@ -26,13 +26,14 @@
 import java.util.HashMap;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.Script;
 
 public class Upgrade301to302 extends LegacyDbUpgrade {
-    final static Logger s_logger = Logger.getLogger(Upgrade301to302.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade301to302.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade302to303.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade302to303.java
index abd0c347df3..6d3fd028cef 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade302to303.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade302to303.java
@@ -28,7 +28,8 @@
 import java.sql.SQLException;
 import java.util.UUID;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 //
 import com.cloud.dc.DataCenter.NetworkType;
@@ -37,7 +38,7 @@
 import com.cloud.utils.script.Script;
 
 public class Upgrade302to303 extends LegacyDbUpgrade {
-    final static Logger s_logger = Logger.getLogger(Upgrade302to303.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade302to303.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade302to40.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade302to40.java
index 829e99852ba..268ce41a277 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade302to40.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade302to40.java
@@ -27,7 +27,8 @@
 import java.util.List;
 import java.util.UUID;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.dc.DataCenter.NetworkType;
 import com.cloud.utils.crypt.DBEncryptionUtil;
@@ -35,7 +36,7 @@
 import com.cloud.utils.script.Script;
 
 public class Upgrade302to40 extends Upgrade30xBase {
-    final static Logger s_logger = Logger.getLogger(Upgrade302to40.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade302to40.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade303to304.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade303to304.java
index 96793d45857..1f14a9a9e57 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade303to304.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade303to304.java
@@ -24,13 +24,14 @@
 import java.sql.SQLException;
 import java.util.UUID;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.utils.crypt.DBEncryptionUtil;
 import com.cloud.utils.exception.CloudRuntimeException;
 
 public class Upgrade303to304 extends Upgrade30xBase implements DbUpgrade {
-    final static Logger s_logger = Logger.getLogger(Upgrade303to304.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade303to304.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade304to305.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade304to305.java
index 3f1268845c0..003d743d85b 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade304to305.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade304to305.java
@@ -27,14 +27,15 @@
 import java.util.List;
 import java.util.UUID;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.utils.crypt.DBEncryptionUtil;
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.Script;
 
 public class Upgrade304to305 extends Upgrade30xBase {
-    final static Logger s_logger = Logger.getLogger(Upgrade304to305.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade304to305.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade305to306.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade305to306.java
index c31ce659a00..58e06450d14 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade305to306.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade305to306.java
@@ -26,13 +26,14 @@
 import java.util.List;
 import java.util.UUID;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.Script;
 
 public class Upgrade305to306 extends Upgrade30xBase {
-    final static Logger s_logger = Logger.getLogger(Upgrade305to306.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade305to306.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade306to307.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade306to307.java
index a911882fa69..a8eb9a3b91e 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade306to307.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade306to307.java
@@ -23,13 +23,14 @@
 import java.sql.ResultSet;
 import java.sql.SQLException;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.Script;
 
 public class Upgrade306to307 extends Upgrade30xBase {
-    final static Logger s_logger = Logger.getLogger(Upgrade306to307.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade306to307.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade307to410.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade307to410.java
index 4319481fe93..ea2a47d7f31 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade307to410.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade307to410.java
@@ -23,14 +23,15 @@
 import java.sql.SQLException;
 import java.util.Properties;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.utils.db.DbProperties;
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.Script;
 
 public class Upgrade307to410 implements DbUpgrade {
-    final static Logger s_logger = Logger.getLogger(Upgrade307to410.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade307to410.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade30to301.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade30to301.java
index fafec269c51..361943b1c1c 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade30to301.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade30to301.java
@@ -22,14 +22,15 @@
 import java.sql.ResultSet;
 import java.sql.SQLException;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.configuration.Resource.ResourceType;
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.Script;
 
 public class Upgrade30to301 extends LegacyDbUpgrade {
-    final static Logger s_logger = Logger.getLogger(Upgrade30to301.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade30to301.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade30xBase.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade30xBase.java
index 47b877d5aa5..f68e4771283 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade30xBase.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade30xBase.java
@@ -23,13 +23,14 @@
 import java.sql.SQLException;
 import java.util.UUID;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.utils.exception.CloudRuntimeException;
 
 public abstract class Upgrade30xBase extends LegacyDbUpgrade {
 
-    final static Logger s_logger = Logger.getLogger(Upgrade30xBase.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade30xBase.class);
 
     protected String getNetworkLabelFromConfig(Connection conn, String name) {
         String sql = "SELECT value FROM `cloud`.`configuration` where name = ?";
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade40to41.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade40to41.java
index ab683fcb4f3..46a479cad8b 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade40to41.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade40to41.java
@@ -25,14 +25,15 @@
 import java.util.Properties;
 import java.util.UUID;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.utils.db.DbProperties;
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.Script;
 
 public class Upgrade40to41 implements DbUpgrade {
-    final static Logger s_logger = Logger.getLogger(Upgrade40to41.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade40to41.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade41000to41100.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade41000to41100.java
index 0189ce8c627..68bf8496754 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade41000to41100.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade41000to41100.java
@@ -19,13 +19,14 @@
 
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.Script;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import java.io.File;
 import java.sql.Connection;
 
 public class Upgrade41000to41100 implements DbUpgrade {
-    final static Logger LOG = Logger.getLogger(Upgrade41000to41100.class);
+    final static Logger LOG = LogManager.getLogger(Upgrade41000to41100.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java
index 7fa2e0cd9e6..b64436a6c46 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java
@@ -32,7 +32,8 @@
 import java.util.Map;
 import java.util.UUID;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreProvider;
 
@@ -45,7 +46,7 @@
 import com.cloud.utils.script.Script;
 
 public class Upgrade410to420 implements DbUpgrade {
-    final static Logger s_logger = Logger.getLogger(Upgrade410to420.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade410to420.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade420to421.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade420to421.java
index d8d0b32bd06..0d3ab14e91a 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade420to421.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade420to421.java
@@ -23,14 +23,15 @@
 import java.sql.ResultSet;
 import java.sql.SQLException;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.hypervisor.Hypervisor;
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.Script;
 
 public class Upgrade420to421 implements DbUpgrade {
-    final static Logger s_logger = Logger.getLogger(Upgrade420to421.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade420to421.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade421to430.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade421to430.java
index e8123640225..eb7ef48646a 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade421to430.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade421to430.java
@@ -26,14 +26,15 @@
 import java.sql.Types;
 
 import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.utils.crypt.DBEncryptionUtil;
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.Script;
 
 public class Upgrade421to430 implements DbUpgrade {
-    final static Logger s_logger = Logger.getLogger(Upgrade421to430.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade421to430.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java
index 51494e7aff6..b8ed5d1668e 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java
@@ -23,7 +23,8 @@
 import java.sql.ResultSet;
 import java.sql.SQLException;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.network.Network;
 import com.cloud.network.Networks.BroadcastDomainType;
@@ -31,7 +32,7 @@
 import com.cloud.utils.script.Script;
 
 public class Upgrade430to440 implements DbUpgrade {
-    final static Logger s_logger = Logger.getLogger(Upgrade430to440.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade430to440.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade431to440.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade431to440.java
index 98b52ac0aa9..4d33547df6c 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade431to440.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade431to440.java
@@ -17,10 +17,11 @@
 
 package com.cloud.upgrade.dao;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class Upgrade431to440 extends Upgrade430to440 implements DbUpgrade {
-    final static Logger s_logger = Logger.getLogger(Upgrade431to440.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade431to440.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade432to440.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade432to440.java
index ded0db474d5..90eb1607c34 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade432to440.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade432to440.java
@@ -17,10 +17,11 @@
 
 package com.cloud.upgrade.dao;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class Upgrade432to440 extends Upgrade431to440 implements DbUpgrade {
-    final static Logger s_logger = Logger.getLogger(Upgrade432to440.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade432to440.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade440to441.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade440to441.java
index 497da8d08d8..063060e1466 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade440to441.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade440to441.java
@@ -20,13 +20,14 @@
 import java.io.File;
 import java.sql.Connection;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.Script;
 
 public class Upgrade440to441 implements DbUpgrade {
-    final static Logger s_logger = Logger.getLogger(Upgrade440to441.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade440to441.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade441to442.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade441to442.java
index bd50dfb0a30..f463c82cad6 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade441to442.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade441to442.java
@@ -20,13 +20,14 @@
 import java.io.File;
 import java.sql.Connection;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.Script;
 
 public class Upgrade441to442 implements DbUpgrade {
-    final static Logger s_logger = Logger.getLogger(Upgrade441to442.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade441to442.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade442to450.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade442to450.java
index a9fb08905be..9a89915839f 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade442to450.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade442to450.java
@@ -28,14 +28,15 @@
 import java.util.List;
 import java.util.Map;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.utils.crypt.DBEncryptionUtil;
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.Script;
 
 public class Upgrade442to450 implements DbUpgrade {
-    final static Logger s_logger = Logger.getLogger(Upgrade442to450.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade442to450.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade443to444.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade443to444.java
index ded67d6495f..b2488a407e0 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade443to444.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade443to444.java
@@ -20,13 +20,14 @@
 import java.io.File;
 import java.sql.Connection;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.Script;
 
 public class Upgrade443to444 implements DbUpgrade {
-    final static Logger s_logger = Logger.getLogger(Upgrade443to444.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade443to444.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade443to450.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade443to450.java
index 983494894b9..982c68b8fc4 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade443to450.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade443to450.java
@@ -17,11 +17,12 @@
 
 package com.cloud.upgrade.dao;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class Upgrade443to450 extends Upgrade442to450 implements DbUpgrade {
 
-    final static Logger s_logger = Logger.getLogger(Upgrade443to450.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade443to450.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade444to450.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade444to450.java
index d872e528bff..6d5276da011 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade444to450.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade444to450.java
@@ -17,11 +17,12 @@
 
 package com.cloud.upgrade.dao;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class Upgrade444to450 extends Upgrade442to450 implements DbUpgrade {
 
-    final static Logger s_logger = Logger.getLogger(Upgrade444to450.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade444to450.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade450to451.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade450to451.java
index b49939fc7c7..321936f4548 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade450to451.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade450to451.java
@@ -26,7 +26,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.jasypt.exceptions.EncryptionOperationNotPossibleException;
 
 import com.cloud.utils.crypt.DBEncryptionUtil;
@@ -34,7 +35,7 @@
 import com.cloud.utils.script.Script;
 
 public class Upgrade450to451 implements DbUpgrade {
-        final static Logger s_logger = Logger.getLogger(Upgrade450to451.class);
+        final static Logger s_logger = LogManager.getLogger(Upgrade450to451.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade451to452.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade451to452.java
index 870e534fb7f..e820b1c547d 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade451to452.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade451to452.java
@@ -19,13 +19,14 @@
 
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.Script;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import java.io.File;
 import java.sql.Connection;
 
 public class Upgrade451to452 implements DbUpgrade {
-    final static Logger s_logger = Logger.getLogger(Upgrade451to452.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade451to452.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade452to453.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade452to453.java
index d1c4661607e..477be271151 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade452to453.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade452to453.java
@@ -19,13 +19,14 @@
 
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.Script;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import java.io.File;
 import java.sql.Connection;
 
 public class Upgrade452to453 implements DbUpgrade {
-    final static Logger s_logger = Logger.getLogger(Upgrade452to453.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade452to453.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade452to460.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade452to460.java
index f6999776797..955a7987a21 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade452to460.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade452to460.java
@@ -25,13 +25,14 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.Script;
 
 public class Upgrade452to460 implements DbUpgrade {
-    final static Logger s_logger = Logger.getLogger(Upgrade452to460.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade452to460.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade453to460.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade453to460.java
index 504cc7336c2..9f7f582f3fd 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade453to460.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade453to460.java
@@ -17,10 +17,11 @@
 
 package com.cloud.upgrade.dao;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class Upgrade453to460 extends Upgrade452to460 implements DbUpgrade {
-    final static Logger s_logger = Logger.getLogger(Upgrade453to460.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade453to460.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade460to461.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade460to461.java
index 9011c2ed10d..6ad97ae5af5 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade460to461.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade460to461.java
@@ -19,13 +19,14 @@
 
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.Script;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import java.io.File;
 import java.sql.Connection;
 
 public class Upgrade460to461 implements DbUpgrade {
-    final static Logger s_logger = Logger.getLogger(Upgrade460to461.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade460to461.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade461to470.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade461to470.java
index 8dbbdb2e9ec..defe6711bcf 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade461to470.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade461to470.java
@@ -19,7 +19,8 @@
 
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.Script;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import java.io.File;
 import java.sql.Connection;
@@ -27,7 +28,7 @@
 import java.sql.SQLException;
 
 public class Upgrade461to470 implements DbUpgrade {
-    final static Logger s_logger = Logger.getLogger(Upgrade461to470.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade461to470.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade470to471.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade470to471.java
index d2a2e202a41..4daa19d7607 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade470to471.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade470to471.java
@@ -19,13 +19,14 @@
 
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.Script;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import java.io.File;
 import java.sql.Connection;
 
 public class Upgrade470to471 implements DbUpgrade {
-    final static Logger s_logger = Logger.getLogger(Upgrade470to471.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade470to471.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade471to480.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade471to480.java
index bde4c0ff24e..81ed8c55e93 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade471to480.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade471to480.java
@@ -19,13 +19,14 @@
 
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.Script;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import java.io.File;
 import java.sql.Connection;
 
 public class Upgrade471to480 implements DbUpgrade {
-    final static Logger s_logger = Logger.getLogger(Upgrade471to480.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade471to480.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade480to481.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade480to481.java
index 26e7d125ec8..f2f26a15953 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade480to481.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade480to481.java
@@ -19,13 +19,14 @@
 
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.Script;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import java.io.File;
 import java.sql.Connection;
 
 public class Upgrade480to481 implements DbUpgrade {
-    final static Logger s_logger = Logger.getLogger(Upgrade480to481.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade480to481.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade481to490.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade481to490.java
index 29e6534105b..fd05ae5ce7c 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade481to490.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade481to490.java
@@ -26,14 +26,15 @@
 import java.sql.SQLException;
 
 import org.apache.cloudstack.acl.RoleType;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.utils.db.ScriptRunner;
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.Script;
 
 public class Upgrade481to490 implements DbUpgrade {
-    final static Logger s_logger = Logger.getLogger(Upgrade481to490.class);
+    final static Logger s_logger = LogManager.getLogger(Upgrade481to490.class);
 
     @Override
     public String[] getUpgradableVersionRange() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade4930to41000.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade4930to41000.java
index 53a910eb449..aa426b62fe8 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade4930to41000.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade4930to41000.java
@@ -20,7 +20,8 @@
 import com.cloud.hypervisor.Hypervisor;
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.Script;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import java.io.File;
 import java.sql.Connection;
@@ -33,7 +34,7 @@
 import java.util.Set;
 
 public class Upgrade4930to41000 implements DbUpgrade {
-    final static Logger LOG = Logger.getLogger(Upgrade4930to41000.class);
+    final static Logger LOG = LogManager.getLogger(Upgrade4930to41000.class);
 
     public static class MemoryValues {
         long max;
diff --git a/engine/schema/src/com/cloud/upgrade/dao/VersionDaoImpl.java b/engine/schema/src/com/cloud/upgrade/dao/VersionDaoImpl.java
index 67fe70fdb29..ca0e92b0374 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/VersionDaoImpl.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/VersionDaoImpl.java
@@ -23,7 +23,8 @@
 import java.util.List;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.upgrade.dao.VersionVO.Step;
@@ -40,7 +41,7 @@
 @Component
 @DB()
 public class VersionDaoImpl extends GenericDaoBase<VersionVO, Long> implements VersionDao {
-    private static final Logger s_logger = Logger.getLogger(VersionDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(VersionDaoImpl.class);
 
     final GenericSearchBuilder<VersionVO, String> CurrentVersionSearch;
     final SearchBuilder<VersionVO> AllFieldsSearch;
diff --git a/engine/schema/src/com/cloud/usage/dao/UsageDaoImpl.java b/engine/schema/src/com/cloud/usage/dao/UsageDaoImpl.java
index 626b8ccf2be..e68aadc7111 100644
--- a/engine/schema/src/com/cloud/usage/dao/UsageDaoImpl.java
+++ b/engine/schema/src/com/cloud/usage/dao/UsageDaoImpl.java
@@ -33,7 +33,8 @@
 import com.cloud.utils.exception.CloudRuntimeException;
 
 import org.apache.cloudstack.acl.RoleType;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import java.sql.PreparedStatement;
@@ -46,7 +47,7 @@
 
 @Component
 public class UsageDaoImpl extends GenericDaoBase<UsageVO, Long> implements UsageDao {
-    public static final Logger s_logger = Logger.getLogger(UsageDaoImpl.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UsageDaoImpl.class.getName());
     private static final String DELETE_ALL = "DELETE FROM cloud_usage";
     private static final String DELETE_ALL_BY_ACCOUNTID = "DELETE FROM cloud_usage WHERE account_id = ?";
     private static final String DELETE_ALL_BY_INTERVAL = "DELETE FROM cloud_usage WHERE end_date < DATE_SUB(CURRENT_DATE(), INTERVAL ? DAY)";
diff --git a/engine/schema/src/com/cloud/usage/dao/UsageIPAddressDaoImpl.java b/engine/schema/src/com/cloud/usage/dao/UsageIPAddressDaoImpl.java
index a1e64e4cb22..4652e3092c4 100644
--- a/engine/schema/src/com/cloud/usage/dao/UsageIPAddressDaoImpl.java
+++ b/engine/schema/src/com/cloud/usage/dao/UsageIPAddressDaoImpl.java
@@ -26,7 +26,8 @@
 
 
 import com.cloud.exception.CloudException;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.usage.UsageIPAddressVO;
@@ -36,7 +37,7 @@
 
 @Component
 public class UsageIPAddressDaoImpl extends GenericDaoBase<UsageIPAddressVO, Long> implements UsageIPAddressDao {
-    public static final Logger s_logger = Logger.getLogger(UsageIPAddressDaoImpl.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UsageIPAddressDaoImpl.class.getName());
 
     protected static final String UPDATE_RELEASED = "UPDATE usage_ip_address SET released = ? WHERE account_id = ? AND public_ip_address = ? and released IS NULL";
     protected static final String GET_USAGE_RECORDS_BY_ACCOUNT =
diff --git a/engine/schema/src/com/cloud/usage/dao/UsageJobDaoImpl.java b/engine/schema/src/com/cloud/usage/dao/UsageJobDaoImpl.java
index 065dc309ebe..820a59b845e 100644
--- a/engine/schema/src/com/cloud/usage/dao/UsageJobDaoImpl.java
+++ b/engine/schema/src/com/cloud/usage/dao/UsageJobDaoImpl.java
@@ -22,7 +22,8 @@
 import java.util.List;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.usage.UsageJobVO;
@@ -34,7 +35,7 @@
 
 @Component
 public class UsageJobDaoImpl extends GenericDaoBase<UsageJobVO, Long> implements UsageJobDao {
-    private static final Logger s_logger = Logger.getLogger(UsageJobDaoImpl.class.getName());
+    private static final Logger s_logger = LogManager.getLogger(UsageJobDaoImpl.class.getName());
 
     private static final String GET_LAST_JOB_SUCCESS_DATE_MILLIS =
         "SELECT end_millis FROM cloud_usage.usage_job WHERE end_millis > 0 and success = 1 ORDER BY end_millis DESC LIMIT 1";
diff --git a/engine/schema/src/com/cloud/usage/dao/UsageLoadBalancerPolicyDaoImpl.java b/engine/schema/src/com/cloud/usage/dao/UsageLoadBalancerPolicyDaoImpl.java
index 969f0c383ec..1a6c705ba9b 100644
--- a/engine/schema/src/com/cloud/usage/dao/UsageLoadBalancerPolicyDaoImpl.java
+++ b/engine/schema/src/com/cloud/usage/dao/UsageLoadBalancerPolicyDaoImpl.java
@@ -26,7 +26,8 @@
 
 
 import com.cloud.exception.CloudException;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.usage.UsageLoadBalancerPolicyVO;
@@ -36,7 +37,7 @@
 
 @Component
 public class UsageLoadBalancerPolicyDaoImpl extends GenericDaoBase<UsageLoadBalancerPolicyVO, Long> implements UsageLoadBalancerPolicyDao {
-    public static final Logger s_logger = Logger.getLogger(UsageLoadBalancerPolicyDaoImpl.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UsageLoadBalancerPolicyDaoImpl.class.getName());
 
     protected static final String REMOVE_BY_USERID_LBID = "DELETE FROM usage_load_balancer_policy WHERE account_id = ? AND id = ?";
     protected static final String UPDATE_DELETED = "UPDATE usage_load_balancer_policy SET deleted = ? WHERE account_id = ? AND id = ? and deleted IS NULL";
diff --git a/engine/schema/src/com/cloud/usage/dao/UsageNetworkDaoImpl.java b/engine/schema/src/com/cloud/usage/dao/UsageNetworkDaoImpl.java
index 8922e1f0aa5..681d31e6ae8 100644
--- a/engine/schema/src/com/cloud/usage/dao/UsageNetworkDaoImpl.java
+++ b/engine/schema/src/com/cloud/usage/dao/UsageNetworkDaoImpl.java
@@ -23,7 +23,8 @@
 import java.util.Map;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.usage.UsageNetworkVO;
@@ -33,7 +34,7 @@
 
 @Component
 public class UsageNetworkDaoImpl extends GenericDaoBase<UsageNetworkVO, Long> implements UsageNetworkDao {
-    private static final Logger s_logger = Logger.getLogger(UsageVMInstanceDaoImpl.class.getName());
+    private static final Logger s_logger = LogManager.getLogger(UsageVMInstanceDaoImpl.class.getName());
     private static final String SELECT_LATEST_STATS =
         "SELECT u.account_id, u.zone_id, u.host_id, u.host_type, u.network_id, u.bytes_sent, u.bytes_received, u.agg_bytes_received, u.agg_bytes_sent, u.event_time_millis "
             + "FROM cloud_usage.usage_network u INNER JOIN (SELECT netusage.account_id as acct_id, netusage.zone_id as z_id, max(netusage.event_time_millis) as max_date "
diff --git a/engine/schema/src/com/cloud/usage/dao/UsageNetworkOfferingDaoImpl.java b/engine/schema/src/com/cloud/usage/dao/UsageNetworkOfferingDaoImpl.java
index 23931f0a84e..24e28a61403 100644
--- a/engine/schema/src/com/cloud/usage/dao/UsageNetworkOfferingDaoImpl.java
+++ b/engine/schema/src/com/cloud/usage/dao/UsageNetworkOfferingDaoImpl.java
@@ -26,7 +26,8 @@
 
 
 import com.cloud.exception.CloudException;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.usage.UsageNetworkOfferingVO;
@@ -36,7 +37,7 @@
 
 @Component
 public class UsageNetworkOfferingDaoImpl extends GenericDaoBase<UsageNetworkOfferingVO, Long> implements UsageNetworkOfferingDao {
-    public static final Logger s_logger = Logger.getLogger(UsageNetworkOfferingDaoImpl.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UsageNetworkOfferingDaoImpl.class.getName());
 
     protected static final String UPDATE_DELETED =
         "UPDATE usage_network_offering SET deleted = ? WHERE account_id = ? AND vm_instance_id = ? AND network_offering_id = ? and deleted IS NULL";
diff --git a/engine/schema/src/com/cloud/usage/dao/UsagePortForwardingRuleDaoImpl.java b/engine/schema/src/com/cloud/usage/dao/UsagePortForwardingRuleDaoImpl.java
index 76d78ceb775..f01ff45304a 100644
--- a/engine/schema/src/com/cloud/usage/dao/UsagePortForwardingRuleDaoImpl.java
+++ b/engine/schema/src/com/cloud/usage/dao/UsagePortForwardingRuleDaoImpl.java
@@ -26,7 +26,8 @@
 
 
 import com.cloud.exception.CloudException;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.usage.UsagePortForwardingRuleVO;
@@ -36,7 +37,7 @@
 
 @Component
 public class UsagePortForwardingRuleDaoImpl extends GenericDaoBase<UsagePortForwardingRuleVO, Long> implements UsagePortForwardingRuleDao {
-    public static final Logger s_logger = Logger.getLogger(UsagePortForwardingRuleDaoImpl.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UsagePortForwardingRuleDaoImpl.class.getName());
 
     protected static final String REMOVE_BY_USERID_PFID = "DELETE FROM usage_port_forwarding WHERE account_id = ? AND id = ?";
     protected static final String UPDATE_DELETED = "UPDATE usage_port_forwarding SET deleted = ? WHERE account_id = ? AND id = ? and deleted IS NULL";
diff --git a/engine/schema/src/com/cloud/usage/dao/UsageSecurityGroupDaoImpl.java b/engine/schema/src/com/cloud/usage/dao/UsageSecurityGroupDaoImpl.java
index f98133f5439..81959ce0b77 100644
--- a/engine/schema/src/com/cloud/usage/dao/UsageSecurityGroupDaoImpl.java
+++ b/engine/schema/src/com/cloud/usage/dao/UsageSecurityGroupDaoImpl.java
@@ -26,7 +26,8 @@
 
 
 import com.cloud.exception.CloudException;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.usage.UsageSecurityGroupVO;
@@ -36,7 +37,7 @@
 
 @Component
 public class UsageSecurityGroupDaoImpl extends GenericDaoBase<UsageSecurityGroupVO, Long> implements UsageSecurityGroupDao {
-    public static final Logger s_logger = Logger.getLogger(UsageSecurityGroupDaoImpl.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UsageSecurityGroupDaoImpl.class.getName());
 
     protected static final String UPDATE_DELETED =
         "UPDATE usage_security_group SET deleted = ? WHERE account_id = ? AND vm_instance_id = ? AND security_group_id = ? and deleted IS NULL";
diff --git a/engine/schema/src/com/cloud/usage/dao/UsageStorageDaoImpl.java b/engine/schema/src/com/cloud/usage/dao/UsageStorageDaoImpl.java
index 45337b22e13..4efff36c82f 100644
--- a/engine/schema/src/com/cloud/usage/dao/UsageStorageDaoImpl.java
+++ b/engine/schema/src/com/cloud/usage/dao/UsageStorageDaoImpl.java
@@ -26,7 +26,8 @@
 
 
 import com.cloud.exception.CloudException;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.usage.UsageStorageVO;
@@ -38,7 +39,7 @@
 
 @Component
 public class UsageStorageDaoImpl extends GenericDaoBase<UsageStorageVO, Long> implements UsageStorageDao {
-    public static final Logger s_logger = Logger.getLogger(UsageStorageDaoImpl.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UsageStorageDaoImpl.class.getName());
 
     protected static final String REMOVE_BY_USERID_STORAGEID = "DELETE FROM usage_storage WHERE account_id = ? AND id = ? AND storage_type = ?";
     protected static final String UPDATE_DELETED = "UPDATE usage_storage SET deleted = ? WHERE account_id = ? AND id = ? AND storage_type = ? AND zone_id = ? and deleted IS NULL";
diff --git a/engine/schema/src/com/cloud/usage/dao/UsageVMInstanceDaoImpl.java b/engine/schema/src/com/cloud/usage/dao/UsageVMInstanceDaoImpl.java
index d330267d0b4..827499eab7b 100644
--- a/engine/schema/src/com/cloud/usage/dao/UsageVMInstanceDaoImpl.java
+++ b/engine/schema/src/com/cloud/usage/dao/UsageVMInstanceDaoImpl.java
@@ -24,7 +24,8 @@
 import java.util.TimeZone;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.usage.UsageVMInstanceVO;
@@ -34,7 +35,7 @@
 
 @Component
 public class UsageVMInstanceDaoImpl extends GenericDaoBase<UsageVMInstanceVO, Long> implements UsageVMInstanceDao {
-    public static final Logger s_logger = Logger.getLogger(UsageVMInstanceDaoImpl.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UsageVMInstanceDaoImpl.class.getName());
 
     protected static final String UPDATE_USAGE_INSTANCE_SQL = "UPDATE usage_vm_instance SET end_date = ? "
         + "WHERE account_id = ? and vm_instance_id = ? and usage_type = ? and end_date IS NULL";
diff --git a/engine/schema/src/com/cloud/usage/dao/UsageVMSnapshotDaoImpl.java b/engine/schema/src/com/cloud/usage/dao/UsageVMSnapshotDaoImpl.java
index 41c4a3a6bbe..f29711afcab 100644
--- a/engine/schema/src/com/cloud/usage/dao/UsageVMSnapshotDaoImpl.java
+++ b/engine/schema/src/com/cloud/usage/dao/UsageVMSnapshotDaoImpl.java
@@ -25,7 +25,8 @@
 import java.util.TimeZone;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.usage.UsageVMSnapshotVO;
@@ -35,7 +36,7 @@
 
 @Component
 public class UsageVMSnapshotDaoImpl extends GenericDaoBase<UsageVMSnapshotVO, Long> implements UsageVMSnapshotDao {
-    public static final Logger s_logger = Logger.getLogger(UsageVMSnapshotDaoImpl.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UsageVMSnapshotDaoImpl.class.getName());
     protected static final String GET_USAGE_RECORDS_BY_ACCOUNT = "SELECT id, zone_id, account_id, domain_id, vm_id, disk_offering_id, size, created, processed "
         + " FROM usage_vmsnapshot" + " WHERE account_id = ? " + " AND ( (created BETWEEN ? AND ?) OR "
         + "      (created < ? AND processed is NULL) ) ORDER BY created asc";
diff --git a/engine/schema/src/com/cloud/usage/dao/UsageVPNUserDaoImpl.java b/engine/schema/src/com/cloud/usage/dao/UsageVPNUserDaoImpl.java
index 9be0ca5d59a..d3e0eb74a1f 100644
--- a/engine/schema/src/com/cloud/usage/dao/UsageVPNUserDaoImpl.java
+++ b/engine/schema/src/com/cloud/usage/dao/UsageVPNUserDaoImpl.java
@@ -26,7 +26,8 @@
 
 
 import com.cloud.exception.CloudException;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.usage.UsageVPNUserVO;
@@ -36,7 +37,7 @@
 
 @Component
 public class UsageVPNUserDaoImpl extends GenericDaoBase<UsageVPNUserVO, Long> implements UsageVPNUserDao {
-    public static final Logger s_logger = Logger.getLogger(UsageVPNUserDaoImpl.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UsageVPNUserDaoImpl.class.getName());
 
     protected static final String UPDATE_DELETED = "UPDATE usage_vpn_user SET deleted = ? WHERE account_id = ? AND user_id = ? and deleted IS NULL";
     protected static final String GET_USAGE_RECORDS_BY_ACCOUNT = "SELECT zone_id, account_id, domain_id, user_id, user_name, created, deleted " + "FROM usage_vpn_user "
diff --git a/engine/schema/src/com/cloud/usage/dao/UsageVmDiskDaoImpl.java b/engine/schema/src/com/cloud/usage/dao/UsageVmDiskDaoImpl.java
index 2b934770b7d..1c790e52e80 100644
--- a/engine/schema/src/com/cloud/usage/dao/UsageVmDiskDaoImpl.java
+++ b/engine/schema/src/com/cloud/usage/dao/UsageVmDiskDaoImpl.java
@@ -23,7 +23,8 @@
 import java.util.Map;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.usage.UsageVmDiskVO;
@@ -33,7 +34,7 @@
 
 @Component
 public class UsageVmDiskDaoImpl extends GenericDaoBase<UsageVmDiskVO, Long> implements UsageVmDiskDao {
-    private static final Logger s_logger = Logger.getLogger(UsageVmDiskDaoImpl.class.getName());
+    private static final Logger s_logger = LogManager.getLogger(UsageVmDiskDaoImpl.class.getName());
     private static final String SELECT_LATEST_STATS =
         "SELECT uvd.account_id, uvd.zone_id, uvd.vm_id, uvd.volume_id, uvd.io_read, uvd.io_write, uvd.agg_io_read, uvd.agg_io_write, "
             + "uvd.bytes_read, uvd.bytes_write, uvd.agg_bytes_read, uvd.agg_bytes_write, uvd.event_time_millis "
diff --git a/engine/schema/src/com/cloud/usage/dao/UsageVolumeDaoImpl.java b/engine/schema/src/com/cloud/usage/dao/UsageVolumeDaoImpl.java
index 9b983a53573..9c4c57f7f4d 100644
--- a/engine/schema/src/com/cloud/usage/dao/UsageVolumeDaoImpl.java
+++ b/engine/schema/src/com/cloud/usage/dao/UsageVolumeDaoImpl.java
@@ -26,7 +26,8 @@
 
 
 import com.cloud.exception.CloudException;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.usage.UsageVolumeVO;
@@ -36,7 +37,7 @@
 
 @Component
 public class UsageVolumeDaoImpl extends GenericDaoBase<UsageVolumeVO, Long> implements UsageVolumeDao {
-    public static final Logger s_logger = Logger.getLogger(UsageVolumeDaoImpl.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(UsageVolumeDaoImpl.class.getName());
 
     protected static final String REMOVE_BY_USERID_VOLID = "DELETE FROM usage_volume WHERE account_id = ? AND id = ?";
     protected static final String UPDATE_DELETED = "UPDATE usage_volume SET deleted = ? WHERE account_id = ? AND id = ? and deleted IS NULL";
diff --git a/engine/schema/src/com/cloud/user/dao/AccountDaoImpl.java b/engine/schema/src/com/cloud/user/dao/AccountDaoImpl.java
index 27891503dc8..ed889a038e2 100644
--- a/engine/schema/src/com/cloud/user/dao/AccountDaoImpl.java
+++ b/engine/schema/src/com/cloud/user/dao/AccountDaoImpl.java
@@ -22,7 +22,8 @@
 import java.util.List;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.user.Account;
@@ -42,7 +43,7 @@
 
 @Component
 public class AccountDaoImpl extends GenericDaoBase<AccountVO, Long> implements AccountDao {
-    private static final Logger s_logger = Logger.getLogger(AccountDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(AccountDaoImpl.class);
     private static final String FIND_USER_ACCOUNT_BY_API_KEY = "SELECT u.id, u.username, u.account_id, u.secret_key, u.state, "
         + "a.id, a.account_name, a.type, a.role_id, a.domain_id, a.state " + "FROM `cloud`.`user` u, `cloud`.`account` a "
         + "WHERE u.account_id = a.id AND u.api_key = ? and u.removed IS NULL";
diff --git a/engine/schema/src/com/cloud/user/dao/UserStatisticsDaoImpl.java b/engine/schema/src/com/cloud/user/dao/UserStatisticsDaoImpl.java
index acadc2f0908..b4992be5bc9 100644
--- a/engine/schema/src/com/cloud/user/dao/UserStatisticsDaoImpl.java
+++ b/engine/schema/src/com/cloud/user/dao/UserStatisticsDaoImpl.java
@@ -24,7 +24,8 @@
 import java.util.TimeZone;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.user.UserStatisticsVO;
@@ -36,7 +37,7 @@
 
 @Component
 public class UserStatisticsDaoImpl extends GenericDaoBase<UserStatisticsVO, Long> implements UserStatisticsDao {
-    private static final Logger s_logger = Logger.getLogger(UserStatisticsDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(UserStatisticsDaoImpl.class);
     private static final String ACTIVE_AND_RECENTLY_DELETED_SEARCH =
         "SELECT us.id, us.data_center_id, us.account_id, us.public_ip_address, us.device_id, us.device_type, us.network_id, us.agg_bytes_received, us.agg_bytes_sent "
             + "FROM user_statistics us, account a " + "WHERE us.account_id = a.id AND (a.removed IS NULL OR a.removed >= ?) " + "ORDER BY us.id";
diff --git a/engine/schema/src/com/cloud/user/dao/VmDiskStatisticsDaoImpl.java b/engine/schema/src/com/cloud/user/dao/VmDiskStatisticsDaoImpl.java
index 34fa2e79e98..908892454dc 100644
--- a/engine/schema/src/com/cloud/user/dao/VmDiskStatisticsDaoImpl.java
+++ b/engine/schema/src/com/cloud/user/dao/VmDiskStatisticsDaoImpl.java
@@ -24,7 +24,8 @@
 import java.util.TimeZone;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.user.VmDiskStatisticsVO;
@@ -36,7 +37,7 @@
 
 @Component
 public class VmDiskStatisticsDaoImpl extends GenericDaoBase<VmDiskStatisticsVO, Long> implements VmDiskStatisticsDao {
-    private static final Logger s_logger = Logger.getLogger(VmDiskStatisticsDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(VmDiskStatisticsDaoImpl.class);
     private static final String ACTIVE_AND_RECENTLY_DELETED_SEARCH =
         "SELECT bcf.id, bcf.data_center_id, bcf.account_id, bcf.vm_id, bcf.volume_id, bcf.agg_io_read, bcf.agg_io_write, bcf.agg_bytes_read, bcf.agg_bytes_write "
             + "FROM vm_disk_statistics bcf, account a " + "WHERE bcf.account_id = a.id AND (a.removed IS NULL OR a.removed >= ?) " + "ORDER BY bcf.id";
diff --git a/engine/schema/src/com/cloud/vm/VMInstanceVO.java b/engine/schema/src/com/cloud/vm/VMInstanceVO.java
index b55e030620b..8ded7246b47 100644
--- a/engine/schema/src/com/cloud/vm/VMInstanceVO.java
+++ b/engine/schema/src/com/cloud/vm/VMInstanceVO.java
@@ -23,7 +23,8 @@
 import com.cloud.utils.fsm.FiniteStateObject;
 import com.cloud.vm.VirtualMachine.State;
 import org.apache.commons.codec.binary.Base64;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import javax.persistence.Column;
 import javax.persistence.DiscriminatorColumn;
@@ -50,7 +51,7 @@
 @Inheritance(strategy = InheritanceType.JOINED)
 @DiscriminatorColumn(name = "type", discriminatorType = DiscriminatorType.STRING, length = 32)
 public class VMInstanceVO implements VirtualMachine, FiniteStateObject<State, VirtualMachine.Event> {
-    private static final Logger s_logger = Logger.getLogger(VMInstanceVO.class);
+    private static final Logger s_logger = LogManager.getLogger(VMInstanceVO.class);
     @Id
     @TableGenerator(name = "vm_instance_sq", table = "sequence", pkColumnName = "name", valueColumnName = "value", pkColumnValue = "vm_instance_seq", allocationSize = 1)
     @Column(name = "id", updatable = false, nullable = false)
diff --git a/engine/schema/src/com/cloud/vm/dao/ConsoleProxyDaoImpl.java b/engine/schema/src/com/cloud/vm/dao/ConsoleProxyDaoImpl.java
index 36ff74b11b3..342f9e9db15 100644
--- a/engine/schema/src/com/cloud/vm/dao/ConsoleProxyDaoImpl.java
+++ b/engine/schema/src/com/cloud/vm/dao/ConsoleProxyDaoImpl.java
@@ -24,7 +24,8 @@
 import java.util.List;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.info.ConsoleProxyLoadInfo;
@@ -40,7 +41,7 @@
 
 @Component
 public class ConsoleProxyDaoImpl extends GenericDaoBase<ConsoleProxyVO, Long> implements ConsoleProxyDao {
-    private static final Logger s_logger = Logger.getLogger(ConsoleProxyDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(ConsoleProxyDaoImpl.class);
 
     //
     // query SQL for returnning console proxy assignment info as following
diff --git a/engine/schema/src/com/cloud/vm/dao/SecondaryStorageVmDaoImpl.java b/engine/schema/src/com/cloud/vm/dao/SecondaryStorageVmDaoImpl.java
index 2b3c0289b23..e42889754fb 100644
--- a/engine/schema/src/com/cloud/vm/dao/SecondaryStorageVmDaoImpl.java
+++ b/engine/schema/src/com/cloud/vm/dao/SecondaryStorageVmDaoImpl.java
@@ -23,7 +23,8 @@
 import java.util.List;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.utils.db.Attribute;
@@ -38,7 +39,7 @@
 
 @Component
 public class SecondaryStorageVmDaoImpl extends GenericDaoBase<SecondaryStorageVmVO, Long> implements SecondaryStorageVmDao {
-    private static final Logger s_logger = Logger.getLogger(SecondaryStorageVmDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(SecondaryStorageVmDaoImpl.class);
 
     protected SearchBuilder<SecondaryStorageVmVO> DataCenterStatusSearch;
     protected SearchBuilder<SecondaryStorageVmVO> StateSearch;
diff --git a/engine/schema/src/com/cloud/vm/dao/UserVmCloneSettingDaoImpl.java b/engine/schema/src/com/cloud/vm/dao/UserVmCloneSettingDaoImpl.java
index 0761f56917b..2aae2376a83 100644
--- a/engine/schema/src/com/cloud/vm/dao/UserVmCloneSettingDaoImpl.java
+++ b/engine/schema/src/com/cloud/vm/dao/UserVmCloneSettingDaoImpl.java
@@ -20,7 +20,8 @@
 
 import javax.annotation.PostConstruct;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.utils.db.DB;
@@ -33,7 +34,7 @@
 @Component
 @DB()
 public class UserVmCloneSettingDaoImpl extends GenericDaoBase<UserVmCloneSettingVO, Long> implements UserVmCloneSettingDao {
-    public static final Logger s_logger = Logger.getLogger(UserVmCloneSettingDaoImpl.class);
+    public static final Logger s_logger = LogManager.getLogger(UserVmCloneSettingDaoImpl.class);
 
     protected SearchBuilder<UserVmCloneSettingVO> vmIdSearch;
     protected SearchBuilder<UserVmCloneSettingVO> cloneTypeSearch;
diff --git a/engine/schema/src/com/cloud/vm/dao/UserVmDaoImpl.java b/engine/schema/src/com/cloud/vm/dao/UserVmDaoImpl.java
index b1ff7060ba1..56aed5f8087 100644
--- a/engine/schema/src/com/cloud/vm/dao/UserVmDaoImpl.java
+++ b/engine/schema/src/com/cloud/vm/dao/UserVmDaoImpl.java
@@ -29,7 +29,8 @@
 import javax.annotation.PostConstruct;
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.tags.dao.ResourceTagDao;
@@ -53,7 +54,7 @@
 import com.cloud.vm.dao.UserVmData.SecurityGroupData;
 
 public class UserVmDaoImpl extends GenericDaoBase<UserVmVO, Long> implements UserVmDao {
-    public static final Logger s_logger = Logger.getLogger(UserVmDaoImpl.class);
+    public static final Logger s_logger = LogManager.getLogger(UserVmDaoImpl.class);
 
     protected SearchBuilder<UserVmVO> AccountPodSearch;
     protected SearchBuilder<UserVmVO> AccountDataCenterSearch;
diff --git a/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java b/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java
index 7065350a57e..3760df95bd3 100644
--- a/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java
+++ b/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java
@@ -28,7 +28,8 @@
 import javax.annotation.PostConstruct;
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.host.HostVO;
@@ -64,7 +65,7 @@
 @Component
 public class VMInstanceDaoImpl extends GenericDaoBase<VMInstanceVO, Long> implements VMInstanceDao {
 
-    public static final Logger s_logger = Logger.getLogger(VMInstanceDaoImpl.class);
+    public static final Logger s_logger = LogManager.getLogger(VMInstanceDaoImpl.class);
     private static final int MAX_CONSECUTIVE_SAME_STATE_UPDATE_COUNT = 3;
 
     protected SearchBuilder<VMInstanceVO> VMClusterSearch;
diff --git a/engine/schema/src/com/cloud/vm/snapshot/dao/VMSnapshotDaoImpl.java b/engine/schema/src/com/cloud/vm/snapshot/dao/VMSnapshotDaoImpl.java
index 1b1842dfd89..75ba755b37e 100644
--- a/engine/schema/src/com/cloud/vm/snapshot/dao/VMSnapshotDaoImpl.java
+++ b/engine/schema/src/com/cloud/vm/snapshot/dao/VMSnapshotDaoImpl.java
@@ -21,7 +21,8 @@
 import java.util.List;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.utils.db.GenericDaoBase;
@@ -36,7 +37,7 @@
 
 @Component
 public class VMSnapshotDaoImpl extends GenericDaoBase<VMSnapshotVO, Long> implements VMSnapshotDao {
-    private static final Logger s_logger = Logger.getLogger(VMSnapshotDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(VMSnapshotDaoImpl.class);
     private final SearchBuilder<VMSnapshotVO> SnapshotSearch;
     private final SearchBuilder<VMSnapshotVO> ExpungingSnapshotSearch;
     private final SearchBuilder<VMSnapshotVO> SnapshotStatusSearch;
diff --git a/engine/schema/src/org/apache/cloudstack/acl/dao/RolePermissionsDaoImpl.java b/engine/schema/src/org/apache/cloudstack/acl/dao/RolePermissionsDaoImpl.java
index 32faf4e9a8c..b1174febe35 100644
--- a/engine/schema/src/org/apache/cloudstack/acl/dao/RolePermissionsDaoImpl.java
+++ b/engine/schema/src/org/apache/cloudstack/acl/dao/RolePermissionsDaoImpl.java
@@ -31,7 +31,8 @@
 import org.apache.cloudstack.acl.RolePermission;
 import org.apache.cloudstack.acl.RolePermission.Permission;
 import org.apache.cloudstack.acl.RolePermissionVO;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import javax.ejb.Local;
@@ -44,7 +45,7 @@
 @Component
 @Local(value = {RolePermissionsDao.class})
 public class RolePermissionsDaoImpl extends GenericDaoBase<RolePermissionVO, Long> implements RolePermissionsDao {
-    protected static final Logger LOGGER = Logger.getLogger(RolePermissionsDaoImpl.class);
+    protected static final Logger LOGGER = LogManager.getLogger(RolePermissionsDaoImpl.class);
 
     private final SearchBuilder<RolePermissionVO> RolePermissionsSearch;
     private Attribute sortOrderAttribute;
diff --git a/engine/schema/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMEntityDaoImpl.java b/engine/schema/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMEntityDaoImpl.java
index 13278a75dd4..4d84e379dc7 100644
--- a/engine/schema/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMEntityDaoImpl.java
+++ b/engine/schema/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMEntityDaoImpl.java
@@ -22,7 +22,8 @@
 import javax.annotation.PostConstruct;
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import org.apache.cloudstack.engine.cloud.entity.api.db.VMEntityVO;
@@ -37,7 +38,7 @@
 @Component
 public class VMEntityDaoImpl extends GenericDaoBase<VMEntityVO, Long> implements VMEntityDao {
 
-    public static final Logger s_logger = Logger.getLogger(VMEntityDaoImpl.class);
+    public static final Logger s_logger = LogManager.getLogger(VMEntityDaoImpl.class);
 
     @Inject
     protected VMReservationDao _vmReservationDao;
diff --git a/engine/schema/src/org/apache/cloudstack/ha/dao/HAConfigDaoImpl.java b/engine/schema/src/org/apache/cloudstack/ha/dao/HAConfigDaoImpl.java
index 4d74e2e6656..dc9f25546bd 100644
--- a/engine/schema/src/org/apache/cloudstack/ha/dao/HAConfigDaoImpl.java
+++ b/engine/schema/src/org/apache/cloudstack/ha/dao/HAConfigDaoImpl.java
@@ -31,7 +31,8 @@
 import org.apache.cloudstack.ha.HAConfig;
 import org.apache.cloudstack.ha.HAConfigVO;
 import org.apache.cloudstack.ha.HAResource;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import java.sql.PreparedStatement;
@@ -42,7 +43,7 @@
 @DB
 @Component
 public class HAConfigDaoImpl extends GenericDaoBase<HAConfigVO, Long> implements HAConfigDao {
-    private static final Logger LOG = Logger.getLogger(HAConfigDaoImpl.class);
+    private static final Logger LOG = LogManager.getLogger(HAConfigDaoImpl.class);
 
     private static final String EXPIRE_OWNERSHIP = "UPDATE ha_config set mgmt_server_id=NULL where mgmt_server_id=?";
 
diff --git a/engine/schema/src/org/apache/cloudstack/outofbandmanagement/dao/OutOfBandManagementDaoImpl.java b/engine/schema/src/org/apache/cloudstack/outofbandmanagement/dao/OutOfBandManagementDaoImpl.java
index 3cdd28fe25a..e6755e5ba53 100644
--- a/engine/schema/src/org/apache/cloudstack/outofbandmanagement/dao/OutOfBandManagementDaoImpl.java
+++ b/engine/schema/src/org/apache/cloudstack/outofbandmanagement/dao/OutOfBandManagementDaoImpl.java
@@ -31,7 +31,8 @@
 import com.cloud.utils.db.UpdateBuilder;
 import org.apache.cloudstack.outofbandmanagement.OutOfBandManagement;
 import org.apache.cloudstack.outofbandmanagement.OutOfBandManagementVO;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import java.sql.PreparedStatement;
@@ -41,7 +42,7 @@
 @DB
 @Component
 public class OutOfBandManagementDaoImpl extends GenericDaoBase<OutOfBandManagementVO, Long> implements OutOfBandManagementDao {
-    private static final Logger LOG = Logger.getLogger(OutOfBandManagementDaoImpl.class);
+    private static final Logger LOG = LogManager.getLogger(OutOfBandManagementDaoImpl.class);
 
     private SearchBuilder<OutOfBandManagementVO> HostSearch;
     private SearchBuilder<OutOfBandManagementVO> ManagementServerSearch;
diff --git a/engine/schema/src/org/apache/cloudstack/region/dao/RegionDaoImpl.java b/engine/schema/src/org/apache/cloudstack/region/dao/RegionDaoImpl.java
index e2ad5d9ed23..96408257b52 100644
--- a/engine/schema/src/org/apache/cloudstack/region/dao/RegionDaoImpl.java
+++ b/engine/schema/src/org/apache/cloudstack/region/dao/RegionDaoImpl.java
@@ -17,7 +17,8 @@
 package org.apache.cloudstack.region.dao;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import org.apache.cloudstack.region.RegionVO;
@@ -28,7 +29,7 @@
 
 @Component
 public class RegionDaoImpl extends GenericDaoBase<RegionVO, Integer> implements RegionDao {
-    private static final Logger s_logger = Logger.getLogger(RegionDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(RegionDaoImpl.class);
     protected SearchBuilder<RegionVO> NameSearch;
     protected SearchBuilder<RegionVO> AllFieldsSearch;
 
diff --git a/engine/schema/src/org/apache/cloudstack/storage/datastore/db/SnapshotDataStoreVO.java b/engine/schema/src/org/apache/cloudstack/storage/datastore/db/SnapshotDataStoreVO.java
index 75b1d75dd6a..942d4078a69 100644
--- a/engine/schema/src/org/apache/cloudstack/storage/datastore/db/SnapshotDataStoreVO.java
+++ b/engine/schema/src/org/apache/cloudstack/storage/datastore/db/SnapshotDataStoreVO.java
@@ -29,7 +29,8 @@
 import javax.persistence.Temporal;
 import javax.persistence.TemporalType;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectInStore;
 import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine;
@@ -46,7 +47,7 @@
 @Entity
 @Table(name = "snapshot_store_ref")
 public class SnapshotDataStoreVO implements StateObject<ObjectInDataStoreStateMachine.State>, DataObjectInStore {
-    private static final Logger s_logger = Logger.getLogger(SnapshotDataStoreVO.class);
+    private static final Logger s_logger = LogManager.getLogger(SnapshotDataStoreVO.class);
 
     @Id
     @GeneratedValue(strategy = GenerationType.IDENTITY)
diff --git a/engine/schema/src/org/apache/cloudstack/storage/datastore/db/TemplateDataStoreVO.java b/engine/schema/src/org/apache/cloudstack/storage/datastore/db/TemplateDataStoreVO.java
index 024f05604c9..7494a3d7a76 100644
--- a/engine/schema/src/org/apache/cloudstack/storage/datastore/db/TemplateDataStoreVO.java
+++ b/engine/schema/src/org/apache/cloudstack/storage/datastore/db/TemplateDataStoreVO.java
@@ -29,7 +29,8 @@
 import javax.persistence.Temporal;
 import javax.persistence.TemporalType;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectInStore;
 import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine;
@@ -47,7 +48,7 @@
 @Entity
 @Table(name = "template_store_ref")
 public class TemplateDataStoreVO implements StateObject<ObjectInDataStoreStateMachine.State>, DataObjectInStore {
-    private static final Logger s_logger = Logger.getLogger(TemplateDataStoreVO.class);
+    private static final Logger s_logger = LogManager.getLogger(TemplateDataStoreVO.class);
 
     @Id
     @GeneratedValue(strategy = GenerationType.IDENTITY)
diff --git a/engine/schema/src/org/apache/cloudstack/storage/datastore/db/VolumeDataStoreVO.java b/engine/schema/src/org/apache/cloudstack/storage/datastore/db/VolumeDataStoreVO.java
index 68baab28ae8..2cc08577a87 100644
--- a/engine/schema/src/org/apache/cloudstack/storage/datastore/db/VolumeDataStoreVO.java
+++ b/engine/schema/src/org/apache/cloudstack/storage/datastore/db/VolumeDataStoreVO.java
@@ -29,7 +29,8 @@
 import javax.persistence.Temporal;
 import javax.persistence.TemporalType;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectInStore;
 import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine;
@@ -46,7 +47,7 @@
 @Entity
 @Table(name = "volume_store_ref")
 public class VolumeDataStoreVO implements StateObject<ObjectInDataStoreStateMachine.State>, DataObjectInStore {
-    private static final Logger s_logger = Logger.getLogger(VolumeDataStoreVO.class);
+    private static final Logger s_logger = LogManager.getLogger(VolumeDataStoreVO.class);
 
     @Id
     @GeneratedValue(strategy = GenerationType.IDENTITY)
diff --git a/engine/schema/test/com/cloud/upgrade/dao/DatabaseAccessObjectTest.java b/engine/schema/test/com/cloud/upgrade/dao/DatabaseAccessObjectTest.java
index 9a2115e9629..8268406cf84 100644
--- a/engine/schema/test/com/cloud/upgrade/dao/DatabaseAccessObjectTest.java
+++ b/engine/schema/test/com/cloud/upgrade/dao/DatabaseAccessObjectTest.java
@@ -16,20 +16,11 @@
 // under the License.
 package com.cloud.upgrade.dao;
 
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Matchers.contains;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.doThrow;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
 import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.SQLException;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.Logger;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -37,6 +28,15 @@
 import org.mockito.internal.util.reflection.Whitebox;
 import org.mockito.runners.MockitoJUnitRunner;
 
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Matchers.contains;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.doThrow;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
 @RunWith(MockitoJUnitRunner.class)
 public class DatabaseAccessObjectTest {
 
diff --git a/engine/storage/cache/src/org/apache/cloudstack/storage/cache/allocator/StorageCacheRandomAllocator.java b/engine/storage/cache/src/org/apache/cloudstack/storage/cache/allocator/StorageCacheRandomAllocator.java
index c9832bf1169..00f7a95fc06 100644
--- a/engine/storage/cache/src/org/apache/cloudstack/storage/cache/allocator/StorageCacheRandomAllocator.java
+++ b/engine/storage/cache/src/org/apache/cloudstack/storage/cache/allocator/StorageCacheRandomAllocator.java
@@ -22,7 +22,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
@@ -39,7 +40,7 @@
 
 @Component
 public class StorageCacheRandomAllocator implements StorageCacheAllocator {
-    private static final Logger s_logger = Logger.getLogger(StorageCacheRandomAllocator.class);
+    private static final Logger s_logger = LogManager.getLogger(StorageCacheRandomAllocator.class);
     @Inject
     DataStoreManager dataStoreMgr;
     @Inject
diff --git a/engine/storage/cache/src/org/apache/cloudstack/storage/cache/manager/StorageCacheManagerImpl.java b/engine/storage/cache/src/org/apache/cloudstack/storage/cache/manager/StorageCacheManagerImpl.java
index 278c80d3247..31067833ff5 100644
--- a/engine/storage/cache/src/org/apache/cloudstack/storage/cache/manager/StorageCacheManagerImpl.java
+++ b/engine/storage/cache/src/org/apache/cloudstack/storage/cache/manager/StorageCacheManagerImpl.java
@@ -32,7 +32,8 @@
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataMotionService;
@@ -64,7 +65,7 @@
 import com.cloud.utils.exception.CloudRuntimeException;
 
 public class StorageCacheManagerImpl implements StorageCacheManager, Manager {
-    private static final Logger s_logger = Logger.getLogger(StorageCacheManagerImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(StorageCacheManagerImpl.class);
     @Inject
     List<StorageCacheAllocator> storageCacheAllocator;
     @Inject
diff --git a/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java b/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java
index 7a1daba910d..1cecd83b44f 100644
--- a/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java
+++ b/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java
@@ -46,7 +46,8 @@
 import org.apache.cloudstack.storage.command.CopyCommand;
 import org.apache.cloudstack.storage.image.datastore.ImageStoreEntity;
 import org.apache.cloudstack.storage.to.PrimaryDataStoreTO;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.agent.api.Answer;
@@ -73,7 +74,7 @@
 
 @Component
 public class AncientDataMotionStrategy implements DataMotionStrategy {
-    private static final Logger s_logger = Logger.getLogger(AncientDataMotionStrategy.class);
+    private static final Logger s_logger = LogManager.getLogger(AncientDataMotionStrategy.class);
     @Inject
     EndPointSelector selector;
     @Inject
diff --git a/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/StorageSystemDataMotionStrategy.java b/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/StorageSystemDataMotionStrategy.java
index 2b722906043..cadf4ba13c8 100644
--- a/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/StorageSystemDataMotionStrategy.java
+++ b/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/StorageSystemDataMotionStrategy.java
@@ -85,7 +85,8 @@
 import org.apache.cloudstack.storage.to.PrimaryDataStoreTO;
 import org.apache.cloudstack.storage.to.VolumeObjectTO;
 import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import javax.inject.Inject;
@@ -101,7 +102,7 @@
 
 @Component
 public class StorageSystemDataMotionStrategy implements DataMotionStrategy {
-    private static final Logger LOGGER = Logger.getLogger(StorageSystemDataMotionStrategy.class);
+    private static final Logger LOGGER = LogManager.getLogger(StorageSystemDataMotionStrategy.class);
     private static final Random RANDOM = new Random(System.nanoTime());
 
     @Inject private AgentManager _agentMgr;
diff --git a/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateDataFactoryImpl.java b/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateDataFactoryImpl.java
index 134e74d58f6..d97908d0145 100644
--- a/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateDataFactoryImpl.java
+++ b/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateDataFactoryImpl.java
@@ -31,7 +31,8 @@
 import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreDao;
 import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreVO;
 import org.apache.cloudstack.storage.image.store.TemplateObject;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.storage.DataStoreRole;
@@ -42,7 +43,7 @@
 
 @Component
 public class TemplateDataFactoryImpl implements TemplateDataFactory {
-    private static final Logger s_logger = Logger.getLogger(TemplateDataFactoryImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(TemplateDataFactoryImpl.class);
     @Inject
     VMTemplateDao imageDataDao;
     @Inject
diff --git a/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateServiceImpl.java b/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateServiceImpl.java
index 7c1695eebea..c03a6c3bd9c 100644
--- a/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateServiceImpl.java
+++ b/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateServiceImpl.java
@@ -90,7 +90,8 @@
 import org.apache.cloudstack.storage.image.datastore.ImageStoreEntity;
 import org.apache.cloudstack.storage.image.store.TemplateObject;
 import org.apache.cloudstack.storage.to.TemplateObjectTO;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import javax.inject.Inject;
@@ -103,7 +104,7 @@
 
 @Component
 public class TemplateServiceImpl implements TemplateService {
-    private static final Logger s_logger = Logger.getLogger(TemplateServiceImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(TemplateServiceImpl.class);
     @Inject
     ObjectInDataStoreManager _objectInDataStoreMgr;
     @Inject
diff --git a/engine/storage/image/src/org/apache/cloudstack/storage/image/manager/ImageStoreProviderManagerImpl.java b/engine/storage/image/src/org/apache/cloudstack/storage/image/manager/ImageStoreProviderManagerImpl.java
index cb9a97e5965..7192e8d20ae 100644
--- a/engine/storage/image/src/org/apache/cloudstack/storage/image/manager/ImageStoreProviderManagerImpl.java
+++ b/engine/storage/image/src/org/apache/cloudstack/storage/image/manager/ImageStoreProviderManagerImpl.java
@@ -28,7 +28,8 @@
 import javax.annotation.PostConstruct;
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
@@ -49,7 +50,7 @@
 
 @Component
 public class ImageStoreProviderManagerImpl implements ImageStoreProviderManager {
-    private static final Logger s_logger = Logger.getLogger(ImageStoreProviderManagerImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(ImageStoreProviderManagerImpl.class);
     @Inject
     ImageStoreDao dataStoreDao;
     @Inject
diff --git a/engine/storage/image/src/org/apache/cloudstack/storage/image/store/ImageStoreImpl.java b/engine/storage/image/src/org/apache/cloudstack/storage/image/store/ImageStoreImpl.java
index 41ce5a230b0..ce930924aa9 100644
--- a/engine/storage/image/src/org/apache/cloudstack/storage/image/store/ImageStoreImpl.java
+++ b/engine/storage/image/src/org/apache/cloudstack/storage/image/store/ImageStoreImpl.java
@@ -25,7 +25,8 @@
 import javax.inject.Inject;
 
 import com.cloud.storage.Upload;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreDriver;
@@ -51,7 +52,7 @@
 import com.cloud.utils.component.ComponentContext;
 
 public class ImageStoreImpl implements ImageStoreEntity {
-    private static final Logger s_logger = Logger.getLogger(ImageStoreImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(ImageStoreImpl.class);
     @Inject
     VMTemplateDao imageDao;
     @Inject
diff --git a/engine/storage/image/src/org/apache/cloudstack/storage/image/store/TemplateObject.java b/engine/storage/image/src/org/apache/cloudstack/storage/image/store/TemplateObject.java
index 6e78f190d5d..f6f81522e3b 100644
--- a/engine/storage/image/src/org/apache/cloudstack/storage/image/store/TemplateObject.java
+++ b/engine/storage/image/src/org/apache/cloudstack/storage/image/store/TemplateObject.java
@@ -23,7 +23,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectInStore;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
@@ -57,7 +58,7 @@
 
 @SuppressWarnings("serial")
 public class TemplateObject implements TemplateInfo {
-    private static final Logger s_logger = Logger.getLogger(TemplateObject.class);
+    private static final Logger s_logger = LogManager.getLogger(TemplateObject.class);
     private VMTemplateVO imageVO;
     private DataStore dataStore;
     private String url;
diff --git a/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/DirectAgentManagerSimpleImpl.java b/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/DirectAgentManagerSimpleImpl.java
index 0e4755e0345..5e889538e93 100644
--- a/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/DirectAgentManagerSimpleImpl.java
+++ b/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/DirectAgentManagerSimpleImpl.java
@@ -26,7 +26,8 @@
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.Listener;
@@ -60,7 +61,7 @@
 import com.cloud.utils.fsm.StateMachine2;
 
 public class DirectAgentManagerSimpleImpl extends ManagerBase implements AgentManager {
-    private static final Logger logger = Logger.getLogger(DirectAgentManagerSimpleImpl.class);
+    private static final Logger logger = LogManager.getLogger(DirectAgentManagerSimpleImpl.class);
     private final Map<Long, ServerResource> hostResourcesMap = new HashMap<Long, ServerResource>();
     @Inject
     HostDao hostDao;
diff --git a/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/MockRpcCallBack.java b/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/MockRpcCallBack.java
index 25f96c26750..ed26ddae327 100644
--- a/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/MockRpcCallBack.java
+++ b/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/MockRpcCallBack.java
@@ -18,7 +18,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
 
@@ -28,7 +29,7 @@
 import com.cloud.utils.db.DB;
 
 public class MockRpcCallBack implements Runnable {
-    private static final Logger s_logger = Logger.getLogger(MockRpcCallBack.class);
+    private static final Logger s_logger = LogManager.getLogger(MockRpcCallBack.class);
     @Inject
     AgentManager agentMgr;
     private Command cmd;
diff --git a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java
index 23e1650ffa0..0a970c2eb83 100644
--- a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java
+++ b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java
@@ -22,7 +22,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectInStore;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
@@ -58,7 +59,7 @@
 import com.cloud.utils.fsm.NoTransitionException;
 
 public class SnapshotObject implements SnapshotInfo {
-    private static final Logger s_logger = Logger.getLogger(SnapshotObject.class);
+    private static final Logger s_logger = LogManager.getLogger(SnapshotObject.class);
     private SnapshotVO snapshot;
     private DataStore store;
     private Object payload;
diff --git a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotServiceImpl.java b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotServiceImpl.java
index 85c25f18839..531f7eb73a7 100644
--- a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotServiceImpl.java
+++ b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotServiceImpl.java
@@ -22,7 +22,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult;
 import org.apache.cloudstack.engine.subsystem.api.storage.CreateCmdResult;
@@ -64,7 +65,7 @@
 
 @Component
 public class SnapshotServiceImpl implements SnapshotService {
-    private static final Logger s_logger = Logger.getLogger(SnapshotServiceImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(SnapshotServiceImpl.class);
     @Inject
     protected SnapshotDao _snapshotDao;
     @Inject
diff --git a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/StorageSystemSnapshotStrategy.java b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/StorageSystemSnapshotStrategy.java
index 185cf567fa0..eea2ccc6426 100644
--- a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/StorageSystemSnapshotStrategy.java
+++ b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/StorageSystemSnapshotStrategy.java
@@ -60,7 +60,8 @@
 import org.apache.cloudstack.storage.command.SnapshotAndCopyCommand;
 import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
 import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import javax.inject.Inject;
@@ -73,7 +74,7 @@
 
 @Component
 public class StorageSystemSnapshotStrategy extends SnapshotStrategyBase {
-    private static final Logger s_logger = Logger.getLogger(StorageSystemSnapshotStrategy.class);
+    private static final Logger s_logger = LogManager.getLogger(StorageSystemSnapshotStrategy.class);
 
     @Inject private AgentManager agentMgr;
     @Inject private ClusterDao clusterDao;
diff --git a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/XenserverSnapshotStrategy.java b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/XenserverSnapshotStrategy.java
index a673a462375..3d87b721a50 100644
--- a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/XenserverSnapshotStrategy.java
+++ b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/XenserverSnapshotStrategy.java
@@ -20,7 +20,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager;
@@ -69,7 +70,7 @@
 
 @Component
 public class XenserverSnapshotStrategy extends SnapshotStrategyBase {
-    private static final Logger s_logger = Logger.getLogger(XenserverSnapshotStrategy.class);
+    private static final Logger s_logger = LogManager.getLogger(XenserverSnapshotStrategy.class);
 
     @Inject
     SnapshotService snapshotSvr;
diff --git a/engine/storage/snapshot/src/org/apache/cloudstack/storage/vmsnapshot/DefaultVMSnapshotStrategy.java b/engine/storage/snapshot/src/org/apache/cloudstack/storage/vmsnapshot/DefaultVMSnapshotStrategy.java
index 71a5e104d31..770b2fefb9e 100644
--- a/engine/storage/snapshot/src/org/apache/cloudstack/storage/vmsnapshot/DefaultVMSnapshotStrategy.java
+++ b/engine/storage/snapshot/src/org/apache/cloudstack/storage/vmsnapshot/DefaultVMSnapshotStrategy.java
@@ -24,7 +24,8 @@
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.engine.subsystem.api.storage.StrategyPriority;
 import org.apache.cloudstack.engine.subsystem.api.storage.VMSnapshotOptions;
@@ -71,7 +72,7 @@
 import com.cloud.vm.snapshot.dao.VMSnapshotDao;
 
 public class DefaultVMSnapshotStrategy extends ManagerBase implements VMSnapshotStrategy {
-    private static final Logger s_logger = Logger.getLogger(DefaultVMSnapshotStrategy.class);
+    private static final Logger s_logger = LogManager.getLogger(DefaultVMSnapshotStrategy.class);
     @Inject
     VMSnapshotHelper vmSnapshotHelper;
     @Inject
diff --git a/engine/storage/src/org/apache/cloudstack/storage/RemoteHostEndPoint.java b/engine/storage/src/org/apache/cloudstack/storage/RemoteHostEndPoint.java
index 3bad62eb574..b8be80d9e08 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/RemoteHostEndPoint.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/RemoteHostEndPoint.java
@@ -24,7 +24,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
 import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
@@ -53,7 +54,7 @@
 import com.cloud.vm.dao.SecondaryStorageVmDao;
 
 public class RemoteHostEndPoint implements EndPoint {
-    private static final Logger s_logger = Logger.getLogger(RemoteHostEndPoint.class);
+    private static final Logger s_logger = LogManager.getLogger(RemoteHostEndPoint.class);
     private long hostId;
     private String hostAddress;
     private String publicAddress;
diff --git a/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java b/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java
index 194f7bd857c..98ed01a30bc 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java
@@ -28,7 +28,8 @@
 import javax.naming.ConfigurationException;
 
 import com.cloud.storage.Storage;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager;
 import org.apache.cloudstack.engine.subsystem.api.storage.StoragePoolAllocator;
@@ -54,7 +55,7 @@
 import com.cloud.vm.VirtualMachineProfile;
 
 public abstract class AbstractStoragePoolAllocator extends AdapterBase implements StoragePoolAllocator {
-    private static final Logger s_logger = Logger.getLogger(AbstractStoragePoolAllocator.class);
+    private static final Logger s_logger = LogManager.getLogger(AbstractStoragePoolAllocator.class);
     @Inject
     StorageManager storageMgr;
     protected @Inject
diff --git a/engine/storage/src/org/apache/cloudstack/storage/allocator/ClusterScopeStoragePoolAllocator.java b/engine/storage/src/org/apache/cloudstack/storage/allocator/ClusterScopeStoragePoolAllocator.java
index b040c74c28c..1e8d0d43163 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/allocator/ClusterScopeStoragePoolAllocator.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/allocator/ClusterScopeStoragePoolAllocator.java
@@ -25,7 +25,8 @@
 import javax.naming.ConfigurationException;
 
 import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.deploy.DeploymentPlan;
@@ -39,7 +40,7 @@
 
 @Component
 public class ClusterScopeStoragePoolAllocator extends AbstractStoragePoolAllocator {
-    private static final Logger s_logger = Logger.getLogger(ClusterScopeStoragePoolAllocator.class);
+    private static final Logger s_logger = LogManager.getLogger(ClusterScopeStoragePoolAllocator.class);
 
     @Inject
     DiskOfferingDao _diskOfferingDao;
diff --git a/engine/storage/src/org/apache/cloudstack/storage/allocator/GarbageCollectingStoragePoolAllocator.java b/engine/storage/src/org/apache/cloudstack/storage/allocator/GarbageCollectingStoragePoolAllocator.java
index b3a1c0d4b10..e739c6c0382 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/allocator/GarbageCollectingStoragePoolAllocator.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/allocator/GarbageCollectingStoragePoolAllocator.java
@@ -22,7 +22,8 @@
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.engine.subsystem.api.storage.StoragePoolAllocator;
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
@@ -36,7 +37,7 @@
 import com.cloud.vm.VirtualMachineProfile;
 
 public class GarbageCollectingStoragePoolAllocator extends AbstractStoragePoolAllocator {
-    private static final Logger s_logger = Logger.getLogger(GarbageCollectingStoragePoolAllocator.class);
+    private static final Logger s_logger = LogManager.getLogger(GarbageCollectingStoragePoolAllocator.class);
 
     StoragePoolAllocator _firstFitStoragePoolAllocator;
     StoragePoolAllocator _localStoragePoolAllocator;
diff --git a/engine/storage/src/org/apache/cloudstack/storage/allocator/LocalStoragePoolAllocator.java b/engine/storage/src/org/apache/cloudstack/storage/allocator/LocalStoragePoolAllocator.java
index 094903658da..62e670f2915 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/allocator/LocalStoragePoolAllocator.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/allocator/LocalStoragePoolAllocator.java
@@ -26,7 +26,8 @@
 
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
 import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.capacity.dao.CapacityDao;
@@ -44,7 +45,7 @@
 
 @Component
 public class LocalStoragePoolAllocator extends AbstractStoragePoolAllocator {
-    private static final Logger s_logger = Logger.getLogger(LocalStoragePoolAllocator.class);
+    private static final Logger s_logger = LogManager.getLogger(LocalStoragePoolAllocator.class);
 
     @Inject
     StoragePoolHostDao _poolHostDao;
diff --git a/engine/storage/src/org/apache/cloudstack/storage/allocator/ZoneWideStoragePoolAllocator.java b/engine/storage/src/org/apache/cloudstack/storage/allocator/ZoneWideStoragePoolAllocator.java
index 7a109669ab7..4ebd240855f 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/allocator/ZoneWideStoragePoolAllocator.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/allocator/ZoneWideStoragePoolAllocator.java
@@ -23,7 +23,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager;
@@ -41,7 +42,7 @@
 
 @Component
 public class ZoneWideStoragePoolAllocator extends AbstractStoragePoolAllocator {
-    private static final Logger s_logger = Logger.getLogger(ZoneWideStoragePoolAllocator.class);
+    private static final Logger s_logger = LogManager.getLogger(ZoneWideStoragePoolAllocator.class);
     @Inject
     PrimaryDataStoreDao _storagePoolDao;
     @Inject
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/DataObjectManagerImpl.java b/engine/storage/src/org/apache/cloudstack/storage/datastore/DataObjectManagerImpl.java
index 2caa3ef3f41..21a4ffd8742 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/DataObjectManagerImpl.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/datastore/DataObjectManagerImpl.java
@@ -20,7 +20,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult;
@@ -42,7 +43,7 @@
 
 @Component
 public class DataObjectManagerImpl implements DataObjectManager {
-    private static final Logger s_logger = Logger.getLogger(DataObjectManagerImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(DataObjectManagerImpl.class);
     @Inject
     ObjectInDataStoreManager objectInDataStoreMgr;
     @Inject
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/ObjectInDataStoreManagerImpl.java b/engine/storage/src/org/apache/cloudstack/storage/datastore/ObjectInDataStoreManagerImpl.java
index 5117b7cb84f..8e304e94945 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/ObjectInDataStoreManagerImpl.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/datastore/ObjectInDataStoreManagerImpl.java
@@ -18,7 +18,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
@@ -58,7 +59,7 @@
 
 @Component
 public class ObjectInDataStoreManagerImpl implements ObjectInDataStoreManager {
-    private static final Logger s_logger = Logger.getLogger(ObjectInDataStoreManagerImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(ObjectInDataStoreManagerImpl.class);
     @Inject
     TemplateDataFactory imageFactory;
     @Inject
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/DataStoreProviderManagerImpl.java b/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/DataStoreProviderManagerImpl.java
index 98eeb6b4405..85f3acefc84 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/DataStoreProviderManagerImpl.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/DataStoreProviderManagerImpl.java
@@ -30,7 +30,8 @@
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import org.apache.cloudstack.api.response.StorageProviderResponse;
@@ -48,7 +49,7 @@
 
 @Component
 public class DataStoreProviderManagerImpl extends ManagerBase implements DataStoreProviderManager, Registry<DataStoreProvider> {
-    private static final Logger s_logger = Logger.getLogger(DataStoreProviderManagerImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(DataStoreProviderManagerImpl.class);
 
     List<DataStoreProvider> providers;
     protected Map<String, DataStoreProvider> providerMap = new ConcurrentHashMap<String, DataStoreProvider>();
diff --git a/engine/storage/src/org/apache/cloudstack/storage/db/ObjectInDataStoreDaoImpl.java b/engine/storage/src/org/apache/cloudstack/storage/db/ObjectInDataStoreDaoImpl.java
index a492e76b991..b569828de2c 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/db/ObjectInDataStoreDaoImpl.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/db/ObjectInDataStoreDaoImpl.java
@@ -21,7 +21,8 @@
 
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectInStore;
@@ -36,7 +37,7 @@
 
 @Component
 public class ObjectInDataStoreDaoImpl extends GenericDaoBase<ObjectInDataStoreVO, Long> implements ObjectInDataStoreDao {
-    private static final Logger s_logger = Logger.getLogger(ObjectInDataStoreDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(ObjectInDataStoreDaoImpl.class);
     private SearchBuilder<ObjectInDataStoreVO> updateStateSearch;
 
     @Override
diff --git a/engine/storage/src/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java b/engine/storage/src/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java
index e414b6c4c35..7c14e9ad99d 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java
@@ -40,7 +40,8 @@
 import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo;
 import org.apache.cloudstack.storage.LocalHostEndpoint;
 import org.apache.cloudstack.storage.RemoteHostEndPoint;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.capacity.CapacityManager;
@@ -61,7 +62,7 @@
 
 @Component
 public class DefaultEndPointSelector implements EndPointSelector {
-    private static final Logger s_logger = Logger.getLogger(DefaultEndPointSelector.class);
+    private static final Logger s_logger = LogManager.getLogger(DefaultEndPointSelector.class);
     @Inject
     private HostDao hostDao;
     private final String findOneHostOnPrimaryStorage = "select t.id from "
diff --git a/engine/storage/src/org/apache/cloudstack/storage/helper/HypervisorHelperImpl.java b/engine/storage/src/org/apache/cloudstack/storage/helper/HypervisorHelperImpl.java
index 9b7007dc4d6..578804f2be4 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/helper/HypervisorHelperImpl.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/helper/HypervisorHelperImpl.java
@@ -23,7 +23,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
 import org.apache.cloudstack.engine.subsystem.api.storage.EndPointSelector;
@@ -56,7 +57,7 @@
 import com.cloud.vm.snapshot.VMSnapshot;
 
 public class HypervisorHelperImpl implements HypervisorHelper {
-    private static final Logger s_logger = Logger.getLogger(HypervisorHelperImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(HypervisorHelperImpl.class);
     @Inject
     EndPointSelector selector;
     @Inject
diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/BaseImageStoreDriverImpl.java b/engine/storage/src/org/apache/cloudstack/storage/image/BaseImageStoreDriverImpl.java
index 288fae4e1a1..d3e9bf20893 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/image/BaseImageStoreDriverImpl.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/image/BaseImageStoreDriverImpl.java
@@ -26,7 +26,8 @@
 import javax.inject.Inject;
 
 import com.cloud.storage.Upload;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult;
 import org.apache.cloudstack.engine.subsystem.api.storage.CreateCmdResult;
@@ -60,7 +61,7 @@
 import com.cloud.utils.net.Proxy;
 
 public abstract class BaseImageStoreDriverImpl implements ImageStoreDriver {
-    private static final Logger s_logger = Logger.getLogger(BaseImageStoreDriverImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(BaseImageStoreDriverImpl.class);
     @Inject
     protected VMTemplateDao _templateDao;
     @Inject
diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/db/SnapshotDataStoreDaoImpl.java b/engine/storage/src/org/apache/cloudstack/storage/image/db/SnapshotDataStoreDaoImpl.java
index c3e48b9b2f3..00bcab70fbb 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/image/db/SnapshotDataStoreDaoImpl.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/image/db/SnapshotDataStoreDaoImpl.java
@@ -30,7 +30,8 @@
 import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine.State;
 import org.apache.cloudstack.storage.datastore.db.SnapshotDataStoreDao;
 import org.apache.cloudstack.storage.datastore.db.SnapshotDataStoreVO;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.storage.SnapshotVO;
@@ -49,7 +50,7 @@
 
 @Component
 public class SnapshotDataStoreDaoImpl extends GenericDaoBase<SnapshotDataStoreVO, Long> implements SnapshotDataStoreDao {
-    private static final Logger s_logger = Logger.getLogger(SnapshotDataStoreDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(SnapshotDataStoreDaoImpl.class);
     private SearchBuilder<SnapshotDataStoreVO> updateStateSearch;
     private SearchBuilder<SnapshotDataStoreVO> storeSearch;
     private SearchBuilder<SnapshotDataStoreVO> destroyedSearch;
diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/db/TemplateDataStoreDaoImpl.java b/engine/storage/src/org/apache/cloudstack/storage/image/db/TemplateDataStoreDaoImpl.java
index 066503b0208..67d9bbce1ea 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/image/db/TemplateDataStoreDaoImpl.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/image/db/TemplateDataStoreDaoImpl.java
@@ -26,7 +26,8 @@
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectInStore;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
@@ -56,7 +57,7 @@
 
 @Component
 public class TemplateDataStoreDaoImpl extends GenericDaoBase<TemplateDataStoreVO, Long> implements TemplateDataStoreDao {
-    private static final Logger s_logger = Logger.getLogger(TemplateDataStoreDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(TemplateDataStoreDaoImpl.class);
     private SearchBuilder<TemplateDataStoreVO> updateStateSearch;
     private SearchBuilder<TemplateDataStoreVO> storeSearch;
     private SearchBuilder<TemplateDataStoreVO> cacheSearch;
diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/db/VolumeDataStoreDaoImpl.java b/engine/storage/src/org/apache/cloudstack/storage/image/db/VolumeDataStoreDaoImpl.java
index 8258042984d..092376f2e64 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/image/db/VolumeDataStoreDaoImpl.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/image/db/VolumeDataStoreDaoImpl.java
@@ -26,7 +26,8 @@
 import javax.naming.ConfigurationException;
 
 import com.cloud.utils.exception.CloudRuntimeException;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectInStore;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
@@ -49,7 +50,7 @@
 
 @Component
 public class VolumeDataStoreDaoImpl extends GenericDaoBase<VolumeDataStoreVO, Long> implements VolumeDataStoreDao {
-    private static final Logger s_logger = Logger.getLogger(VolumeDataStoreDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(VolumeDataStoreDaoImpl.class);
     private SearchBuilder<VolumeDataStoreVO> updateStateSearch;
     private SearchBuilder<VolumeDataStoreVO> volumeSearch;
     private SearchBuilder<VolumeDataStoreVO> storeSearch;
diff --git a/engine/storage/src/org/apache/cloudstack/storage/volume/datastore/PrimaryDataStoreHelper.java b/engine/storage/src/org/apache/cloudstack/storage/volume/datastore/PrimaryDataStoreHelper.java
index 31b57080aec..cddf07bc667 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/volume/datastore/PrimaryDataStoreHelper.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/volume/datastore/PrimaryDataStoreHelper.java
@@ -26,7 +26,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
@@ -55,7 +56,7 @@
 
 @Component
 public class PrimaryDataStoreHelper {
-    private static final Logger s_logger = Logger.getLogger(PrimaryDataStoreHelper.class);
+    private static final Logger s_logger = LogManager.getLogger(PrimaryDataStoreHelper.class);
     @Inject
     private PrimaryDataStoreDao dataStoreDao;
     @Inject
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/PrimaryDataStoreImpl.java b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/PrimaryDataStoreImpl.java
index 81966784be0..253d261e67c 100644
--- a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/PrimaryDataStoreImpl.java
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/PrimaryDataStoreImpl.java
@@ -46,7 +46,8 @@
 import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
 import org.apache.cloudstack.storage.to.PrimaryDataStoreTO;
 import org.apache.cloudstack.storage.volume.VolumeObject;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.agent.api.to.DataObjectType;
 import com.cloud.agent.api.to.DataStoreTO;
@@ -68,7 +69,7 @@
 
 @SuppressWarnings("serial")
 public class PrimaryDataStoreImpl implements PrimaryDataStore {
-    private static final Logger s_logger = Logger.getLogger(PrimaryDataStoreImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(PrimaryDataStoreImpl.class);
 
     protected PrimaryDataStoreDriver driver;
     protected StoragePoolVO pdsv;
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/provider/DefaultHostListener.java b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/provider/DefaultHostListener.java
index 64533d54d2f..ec998149968 100644
--- a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/provider/DefaultHostListener.java
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/provider/DefaultHostListener.java
@@ -22,7 +22,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager;
 import org.apache.cloudstack.engine.subsystem.api.storage.HypervisorHostListener;
@@ -42,7 +43,7 @@
 import com.cloud.utils.exception.CloudRuntimeException;
 
 public class DefaultHostListener implements HypervisorHostListener {
-    private static final Logger s_logger = Logger.getLogger(DefaultHostListener.class);
+    private static final Logger s_logger = LogManager.getLogger(DefaultHostListener.class);
     @Inject
     AgentManager agentMgr;
     @Inject
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java
index b7f459227aa..992e5618624 100644
--- a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java
@@ -20,7 +20,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectInStore;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
@@ -57,7 +58,7 @@
 import com.cloud.vm.dao.VMInstanceDao;
 
 public class VolumeObject implements VolumeInfo {
-    private static final Logger s_logger = Logger.getLogger(VolumeObject.class);
+    private static final Logger s_logger = LogManager.getLogger(VolumeObject.class);
     protected VolumeVO volumeVO;
     private StateMachine2<Volume.State, Volume.Event, Volume> _volStateMachine;
     protected DataStore dataStore;
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
index 8818724e722..ff223f62f95 100644
--- a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
@@ -68,7 +68,8 @@
 import org.apache.cloudstack.storage.image.store.TemplateObject;
 import org.apache.cloudstack.storage.to.TemplateObjectTO;
 import org.apache.cloudstack.storage.to.VolumeObjectTO;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.agent.api.Answer;
@@ -122,7 +123,7 @@
 
 @Component
 public class VolumeServiceImpl implements VolumeService {
-    private static final Logger s_logger = Logger.getLogger(VolumeServiceImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(VolumeServiceImpl.class);
     @Inject
     VolumeDao volDao;
     @Inject
diff --git a/framework/cluster/src/com/cloud/cluster/ClusterFenceManagerImpl.java b/framework/cluster/src/com/cloud/cluster/ClusterFenceManagerImpl.java
index 0b14be8be0d..4909d37c1a0 100644
--- a/framework/cluster/src/com/cloud/cluster/ClusterFenceManagerImpl.java
+++ b/framework/cluster/src/com/cloud/cluster/ClusterFenceManagerImpl.java
@@ -22,14 +22,15 @@
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.utils.component.ManagerBase;
 
 @Component
 public class ClusterFenceManagerImpl extends ManagerBase implements ClusterFenceManager, ClusterManagerListener {
-    private static final Logger s_logger = Logger.getLogger(ClusterFenceManagerImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(ClusterFenceManagerImpl.class);
 
     @Inject
     ClusterManager _clusterMgr;
diff --git a/framework/cluster/src/com/cloud/cluster/ClusterManagerImpl.java b/framework/cluster/src/com/cloud/cluster/ClusterManagerImpl.java
index 2e20f241e01..50f151d9ada 100644
--- a/framework/cluster/src/com/cloud/cluster/ClusterManagerImpl.java
+++ b/framework/cluster/src/com/cloud/cluster/ClusterManagerImpl.java
@@ -45,7 +45,8 @@
 import org.apache.cloudstack.framework.config.Configurable;
 import org.apache.cloudstack.managed.context.ManagedContextRunnable;
 import org.apache.cloudstack.utils.identity.ManagementServerNode;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.cluster.dao.ManagementServerHostDao;
 import com.cloud.cluster.dao.ManagementServerHostPeerDao;
@@ -68,7 +69,7 @@
 import com.cloud.utils.net.NetUtils;
 
 public class ClusterManagerImpl extends ManagerBase implements ClusterManager, Configurable {
-    private static final Logger s_logger = Logger.getLogger(ClusterManagerImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(ClusterManagerImpl.class);
 
     private static final int EXECUTOR_SHUTDOWN_TIMEOUT = 1000; // 1 second
     private static final int DEFAULT_OUTGOING_WORKERS = 5;
diff --git a/framework/cluster/src/com/cloud/cluster/ClusterServiceServletAdapter.java b/framework/cluster/src/com/cloud/cluster/ClusterServiceServletAdapter.java
index 7451b5f4226..c8d1f0d31db 100644
--- a/framework/cluster/src/com/cloud/cluster/ClusterServiceServletAdapter.java
+++ b/framework/cluster/src/com/cloud/cluster/ClusterServiceServletAdapter.java
@@ -23,7 +23,8 @@
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.apache.cloudstack.framework.config.ConfigDepot;
 
 import com.cloud.cluster.dao.ManagementServerHostDao;
@@ -34,7 +35,7 @@
 
 public class ClusterServiceServletAdapter extends AdapterBase implements ClusterServiceAdapter {
 
-    private static final Logger s_logger = Logger.getLogger(ClusterServiceServletAdapter.class);
+    private static final Logger s_logger = LogManager.getLogger(ClusterServiceServletAdapter.class);
     private static final int DEFAULT_SERVICE_PORT = 9090;
     private static final int DEFAULT_REQUEST_TIMEOUT = 300;            // 300 seconds
 
diff --git a/framework/cluster/src/com/cloud/cluster/ClusterServiceServletContainer.java b/framework/cluster/src/com/cloud/cluster/ClusterServiceServletContainer.java
index 08f5dba69f6..9c830609668 100644
--- a/framework/cluster/src/com/cloud/cluster/ClusterServiceServletContainer.java
+++ b/framework/cluster/src/com/cloud/cluster/ClusterServiceServletContainer.java
@@ -41,14 +41,15 @@
 import org.apache.http.protocol.ResponseContent;
 import org.apache.http.protocol.ResponseDate;
 import org.apache.http.protocol.ResponseServer;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.managed.context.ManagedContextRunnable;
 
 import com.cloud.utils.concurrency.NamedThreadFactory;
 
 public class ClusterServiceServletContainer {
-    private static final Logger s_logger = Logger.getLogger(ClusterServiceServletContainer.class);
+    private static final Logger s_logger = LogManager.getLogger(ClusterServiceServletContainer.class);
 
     private ListenerThread listenerThread;
 
diff --git a/framework/cluster/src/com/cloud/cluster/ClusterServiceServletHttpHandler.java b/framework/cluster/src/com/cloud/cluster/ClusterServiceServletHttpHandler.java
index e12e0fe5ae0..97803f31b10 100644
--- a/framework/cluster/src/com/cloud/cluster/ClusterServiceServletHttpHandler.java
+++ b/framework/cluster/src/com/cloud/cluster/ClusterServiceServletHttpHandler.java
@@ -29,10 +29,11 @@
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.protocol.HttpRequestHandler;
 import org.apache.http.util.EntityUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class ClusterServiceServletHttpHandler implements HttpRequestHandler {
-    private static final Logger s_logger = Logger.getLogger(ClusterServiceServletHttpHandler.class);
+    private static final Logger s_logger = LogManager.getLogger(ClusterServiceServletHttpHandler.class);
 
     private final ClusterManager manager;
 
diff --git a/framework/cluster/src/com/cloud/cluster/ClusterServiceServletImpl.java b/framework/cluster/src/com/cloud/cluster/ClusterServiceServletImpl.java
index ec8b90866d0..31327c86060 100644
--- a/framework/cluster/src/com/cloud/cluster/ClusterServiceServletImpl.java
+++ b/framework/cluster/src/com/cloud/cluster/ClusterServiceServletImpl.java
@@ -25,13 +25,14 @@
 import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
 import org.apache.commons.httpclient.methods.PostMethod;
 import org.apache.commons.httpclient.params.HttpClientParams;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.utils.Profiler;
 
 public class ClusterServiceServletImpl implements ClusterService {
     private static final long serialVersionUID = 4574025200012566153L;
-    private static final Logger s_logger = Logger.getLogger(ClusterServiceServletImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(ClusterServiceServletImpl.class);
 
     private String _serviceUrl;
 
diff --git a/framework/cluster/src/com/cloud/cluster/dao/ManagementServerHostDaoImpl.java b/framework/cluster/src/com/cloud/cluster/dao/ManagementServerHostDaoImpl.java
index 3ab4d97ee05..1d59c1c97f4 100644
--- a/framework/cluster/src/com/cloud/cluster/dao/ManagementServerHostDaoImpl.java
+++ b/framework/cluster/src/com/cloud/cluster/dao/ManagementServerHostDaoImpl.java
@@ -25,7 +25,8 @@
 import java.util.TimeZone;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.cluster.ClusterInvalidSessionException;
 import com.cloud.cluster.ManagementServerHost;
@@ -41,7 +42,7 @@
 import com.cloud.utils.exception.CloudRuntimeException;
 
 public class ManagementServerHostDaoImpl extends GenericDaoBase<ManagementServerHostVO, Long> implements ManagementServerHostDao {
-    private static final Logger s_logger = Logger.getLogger(ManagementServerHostDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(ManagementServerHostDaoImpl.class);
 
     private final SearchBuilder<ManagementServerHostVO> MsIdSearch;
     private final SearchBuilder<ManagementServerHostVO> ActiveSearch;
diff --git a/framework/cluster/src/com/cloud/cluster/dao/ManagementServerHostPeerDaoImpl.java b/framework/cluster/src/com/cloud/cluster/dao/ManagementServerHostPeerDaoImpl.java
index a43fcfc8d30..64319232f63 100644
--- a/framework/cluster/src/com/cloud/cluster/dao/ManagementServerHostPeerDaoImpl.java
+++ b/framework/cluster/src/com/cloud/cluster/dao/ManagementServerHostPeerDaoImpl.java
@@ -19,7 +19,8 @@
 import java.util.List;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.cluster.ManagementServerHost;
 import com.cloud.cluster.ManagementServerHostPeerVO;
@@ -30,7 +31,7 @@
 import com.cloud.utils.db.TransactionLegacy;
 
 public class ManagementServerHostPeerDaoImpl extends GenericDaoBase<ManagementServerHostPeerVO, Long> implements ManagementServerHostPeerDao {
-    private static final Logger s_logger = Logger.getLogger(ManagementServerHostPeerDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(ManagementServerHostPeerDaoImpl.class);
 
     private final SearchBuilder<ManagementServerHostPeerVO> ClearPeerSearch;
     private final SearchBuilder<ManagementServerHostPeerVO> FindForUpdateSearch;
diff --git a/framework/config/src/org/apache/cloudstack/framework/config/dao/ConfigurationDaoImpl.java b/framework/config/src/org/apache/cloudstack/framework/config/dao/ConfigurationDaoImpl.java
index 4e7b127a417..ab4bf6f84f9 100644
--- a/framework/config/src/org/apache/cloudstack/framework/config/dao/ConfigurationDaoImpl.java
+++ b/framework/config/src/org/apache/cloudstack/framework/config/dao/ConfigurationDaoImpl.java
@@ -25,7 +25,8 @@
 import javax.naming.ConfigurationException;
 
 import org.apache.cloudstack.framework.config.impl.ConfigurationVO;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.utils.component.ComponentLifecycle;
@@ -39,7 +40,7 @@
 
 @Component
 public class ConfigurationDaoImpl extends GenericDaoBase<ConfigurationVO, String> implements ConfigurationDao {
-    private static final Logger s_logger = Logger.getLogger(ConfigurationDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(ConfigurationDaoImpl.class);
     private Map<String, String> _configs = null;
     private boolean _premium;
 
diff --git a/framework/config/src/org/apache/cloudstack/framework/config/impl/ConfigDepotImpl.java b/framework/config/src/org/apache/cloudstack/framework/config/impl/ConfigDepotImpl.java
index e68fd3cdae3..84833f4e491 100644
--- a/framework/config/src/org/apache/cloudstack/framework/config/impl/ConfigDepotImpl.java
+++ b/framework/config/src/org/apache/cloudstack/framework/config/impl/ConfigDepotImpl.java
@@ -34,7 +34,8 @@
 import org.apache.cloudstack.framework.config.ScopedConfigStorage;
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
 import org.apache.commons.lang.ObjectUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.utils.Pair;
 import com.cloud.utils.exception.CloudRuntimeException;
@@ -67,7 +68,7 @@
  *     validation class to validate the value the admin input for the key.
  */
 public class ConfigDepotImpl implements ConfigDepot, ConfigDepotAdmin {
-    private final static Logger s_logger = Logger.getLogger(ConfigDepotImpl.class);
+    private final static Logger s_logger = LogManager.getLogger(ConfigDepotImpl.class);
     @Inject
     ConfigurationDao _configDao;
     List<Configurable> _configurables;
diff --git a/framework/db/src/com/cloud/utils/db/ConnectionConcierge.java b/framework/db/src/com/cloud/utils/db/ConnectionConcierge.java
index a1c473d5ffd..d63f546ea95 100644
--- a/framework/db/src/com/cloud/utils/db/ConnectionConcierge.java
+++ b/framework/db/src/com/cloud/utils/db/ConnectionConcierge.java
@@ -30,7 +30,8 @@
 
 import javax.management.StandardMBean;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.managed.context.ManagedContextRunnable;
 
@@ -45,7 +46,7 @@
  */
 public class ConnectionConcierge {
 
-    static final Logger s_logger = Logger.getLogger(ConnectionConcierge.class);
+    static final Logger s_logger = LogManager.getLogger(ConnectionConcierge.class);
 
     static final ConnectionConciergeManager s_mgr = new ConnectionConciergeManager();
 
diff --git a/framework/db/src/com/cloud/utils/db/DbUtil.java b/framework/db/src/com/cloud/utils/db/DbUtil.java
index f7f785062e5..fef5fbd5c60 100644
--- a/framework/db/src/com/cloud/utils/db/DbUtil.java
+++ b/framework/db/src/com/cloud/utils/db/DbUtil.java
@@ -41,12 +41,13 @@
 import javax.persistence.Table;
 import javax.persistence.Transient;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import static com.cloud.utils.AutoCloseableUtil.closeAutoCloseable;
 
 public class DbUtil {
-    protected final static Logger s_logger = Logger.getLogger(DbUtil.class);
+    protected final static Logger s_logger = LogManager.getLogger(DbUtil.class);
 
     private static Map<String, Connection> s_connectionForGlobalLocks = new HashMap<String, Connection>();
 
diff --git a/framework/db/src/com/cloud/utils/db/DriverLoader.java b/framework/db/src/com/cloud/utils/db/DriverLoader.java
index 06c8da5c355..f0e5fba53bf 100644
--- a/framework/db/src/com/cloud/utils/db/DriverLoader.java
+++ b/framework/db/src/com/cloud/utils/db/DriverLoader.java
@@ -17,7 +17,8 @@
 package com.cloud.utils.db;
 
 import com.cloud.utils.exception.CloudRuntimeException;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -26,7 +27,7 @@
 
 public class DriverLoader {
 
-    private static final Logger LOGGER = Logger.getLogger(DriverLoader.class.getName());
+    private static final Logger LOGGER = LogManager.getLogger(DriverLoader.class.getName());
     private static final List<String> LOADED_DRIVERS;
     private static final Map<String, String> DRIVERS;
 
diff --git a/framework/db/src/com/cloud/utils/db/GenericDaoBase.java b/framework/db/src/com/cloud/utils/db/GenericDaoBase.java
index c5a4cd85dd8..cb1c860f413 100644
--- a/framework/db/src/com/cloud/utils/db/GenericDaoBase.java
+++ b/framework/db/src/com/cloud/utils/db/GenericDaoBase.java
@@ -65,7 +65,8 @@
 import net.sf.ehcache.CacheManager;
 import net.sf.ehcache.Element;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.utils.DateUtil;
 import com.cloud.utils.NumbersUtil;
@@ -115,7 +116,7 @@
  **/
 @DB
 public abstract class GenericDaoBase<T, ID extends Serializable> extends ComponentLifecycleBase implements GenericDao<T, ID>, ComponentMethodInterceptable {
-    private final static Logger s_logger = Logger.getLogger(GenericDaoBase.class);
+    private final static Logger s_logger = LogManager.getLogger(GenericDaoBase.class);
 
     protected final static TimeZone s_gmtTimeZone = TimeZone.getTimeZone("GMT");
 
diff --git a/framework/db/src/com/cloud/utils/db/GlobalLock.java b/framework/db/src/com/cloud/utils/db/GlobalLock.java
index 662ba921ce9..4fcc5ea4e48 100644
--- a/framework/db/src/com/cloud/utils/db/GlobalLock.java
+++ b/framework/db/src/com/cloud/utils/db/GlobalLock.java
@@ -22,7 +22,8 @@
 import java.util.Map;
 import java.util.concurrent.Callable;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.utils.Profiler;
 
@@ -43,7 +44,7 @@
 //        lock.releaseRef();
 //
 public class GlobalLock {
-    protected final static Logger s_logger = Logger.getLogger(GlobalLock.class);
+    protected final static Logger s_logger = LogManager.getLogger(GlobalLock.class);
 
     private String name;
     private int lockCount = 0;
diff --git a/framework/db/src/com/cloud/utils/db/Merovingian2.java b/framework/db/src/com/cloud/utils/db/Merovingian2.java
index d2537e369bd..d8ee8ee6e90 100644
--- a/framework/db/src/com/cloud/utils/db/Merovingian2.java
+++ b/framework/db/src/com/cloud/utils/db/Merovingian2.java
@@ -29,7 +29,8 @@
 
 import javax.management.StandardMBean;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.utils.DateUtil;
 import com.cloud.utils.exception.CloudRuntimeException;
@@ -37,7 +38,7 @@
 import com.cloud.utils.time.InaccurateClock;
 
 public class Merovingian2 extends StandardMBean implements MerovingianMBean {
-    private static final Logger s_logger = Logger.getLogger(Merovingian2.class);
+    private static final Logger s_logger = LogManager.getLogger(Merovingian2.class);
 
     private static final String ACQUIRE_SQL =
             "INSERT INTO op_lock (op_lock.key, op_lock.mac, op_lock.ip, op_lock.thread, op_lock.acquired_on, waiters) VALUES (?, ?, ?, ?, ?, 1)";
diff --git a/framework/db/src/com/cloud/utils/db/ScriptRunner.java b/framework/db/src/com/cloud/utils/db/ScriptRunner.java
index 45494b93915..9ecaecd016b 100644
--- a/framework/db/src/com/cloud/utils/db/ScriptRunner.java
+++ b/framework/db/src/com/cloud/utils/db/ScriptRunner.java
@@ -29,13 +29,14 @@
 import java.sql.SQLException;
 import java.sql.Statement;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 /**
  * Tool to run database scripts
  */
 public class ScriptRunner {
-    private static Logger s_logger = Logger.getLogger(ScriptRunner.class);
+    private static Logger s_logger = LogManager.getLogger(ScriptRunner.class);
 
     private static final String DEFAULT_DELIMITER = ";";
 
diff --git a/framework/db/src/com/cloud/utils/db/SequenceFetcher.java b/framework/db/src/com/cloud/utils/db/SequenceFetcher.java
index 7785d566570..7d18ecea981 100644
--- a/framework/db/src/com/cloud/utils/db/SequenceFetcher.java
+++ b/framework/db/src/com/cloud/utils/db/SequenceFetcher.java
@@ -29,7 +29,8 @@
 
 import javax.persistence.TableGenerator;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.utils.concurrency.NamedThreadFactory;
 
@@ -42,7 +43,7 @@
  *
  */
 public class SequenceFetcher {
-    private final static Logger s_logger = Logger.getLogger(SequenceFetcher.class);
+    private final static Logger s_logger = LogManager.getLogger(SequenceFetcher.class);
     ExecutorService _executors;
     private final static Random random = new Random();
 
diff --git a/framework/db/src/com/cloud/utils/db/Transaction.java b/framework/db/src/com/cloud/utils/db/Transaction.java
index c6a491a216d..6dddc752965 100644
--- a/framework/db/src/com/cloud/utils/db/Transaction.java
+++ b/framework/db/src/com/cloud/utils/db/Transaction.java
@@ -18,14 +18,15 @@
 
 import java.util.concurrent.atomic.AtomicLong;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class Transaction {
     private final static AtomicLong counter = new AtomicLong(0);
     private final static TransactionStatus STATUS = new TransactionStatus() {
     };
 
-    private static final Logger s_logger = Logger.getLogger(Transaction.class);
+    private static final Logger s_logger = LogManager.getLogger(Transaction.class);
 
     @SuppressWarnings("deprecation")
     public static <T, E extends Throwable> T execute(TransactionCallbackWithException<T, E> callback) throws E {
diff --git a/framework/db/src/com/cloud/utils/db/TransactionLegacy.java b/framework/db/src/com/cloud/utils/db/TransactionLegacy.java
index 6a422d30fc3..ddcddc8424a 100644
--- a/framework/db/src/com/cloud/utils/db/TransactionLegacy.java
+++ b/framework/db/src/com/cloud/utils/db/TransactionLegacy.java
@@ -40,7 +40,8 @@
 import org.apache.commons.pool.KeyedObjectPoolFactory;
 import org.apache.commons.pool.impl.GenericObjectPool;
 import org.apache.commons.pool.impl.StackKeyedObjectPoolFactory;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.utils.Pair;
 import com.cloud.utils.PropertiesUtil;
@@ -62,10 +63,10 @@
  * it is stored with TLS and is one per thread.  Use appropriately.
  */
 public class TransactionLegacy implements Closeable {
-    private static final Logger s_logger = Logger.getLogger(Transaction.class.getName() + "." + "Transaction");
-    private static final Logger s_stmtLogger = Logger.getLogger(Transaction.class.getName() + "." + "Statement");
-    private static final Logger s_lockLogger = Logger.getLogger(Transaction.class.getName() + "." + "Lock");
-    private static final Logger s_connLogger = Logger.getLogger(Transaction.class.getName() + "." + "Connection");
+    private static final Logger s_logger = LogManager.getLogger(Transaction.class.getName() + "." + "Transaction");
+    private static final Logger s_stmtLogger = LogManager.getLogger(Transaction.class.getName() + "." + "Statement");
+    private static final Logger s_lockLogger = LogManager.getLogger(Transaction.class.getName() + "." + "Lock");
+    private static final Logger s_connLogger = LogManager.getLogger(Transaction.class.getName() + "." + "Connection");
 
     private static final ThreadLocal<TransactionLegacy> tls = new ThreadLocal<TransactionLegacy>();
     private static final String START_TXN = "start_txn";
diff --git a/framework/db/test/com/cloud/utils/db/DbAnnotatedBase.java b/framework/db/test/com/cloud/utils/db/DbAnnotatedBase.java
index 146f79adf0b..45ade278540 100644
--- a/framework/db/test/com/cloud/utils/db/DbAnnotatedBase.java
+++ b/framework/db/test/com/cloud/utils/db/DbAnnotatedBase.java
@@ -21,13 +21,14 @@
 
 import junit.framework.Assert;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 @Component
 @DB
 public class DbAnnotatedBase {
-    private static final Logger s_logger = Logger.getLogger(DbAnnotatedBase.class);
+    private static final Logger s_logger = LogManager.getLogger(DbAnnotatedBase.class);
 
     @Inject
     DummyComponent _dummy;
diff --git a/framework/db/test/com/cloud/utils/db/ElementCollectionTest.java b/framework/db/test/com/cloud/utils/db/ElementCollectionTest.java
index 44f183dc8cd..e1c9b101b8e 100644
--- a/framework/db/test/com/cloud/utils/db/ElementCollectionTest.java
+++ b/framework/db/test/com/cloud/utils/db/ElementCollectionTest.java
@@ -29,10 +29,11 @@
 
 import junit.framework.TestCase;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class ElementCollectionTest extends TestCase {
-    static final Logger s_logger = Logger.getLogger(ElementCollectionTest.class);
+    static final Logger s_logger = LogManager.getLogger(ElementCollectionTest.class);
     ArrayList<String> ar = null;
     List<String> lst = null;
     Collection<String> coll = null;
diff --git a/framework/db/test/com/cloud/utils/db/GlobalLockTest.java b/framework/db/test/com/cloud/utils/db/GlobalLockTest.java
index 79f96707bf0..f9a6d7331dd 100644
--- a/framework/db/test/com/cloud/utils/db/GlobalLockTest.java
+++ b/framework/db/test/com/cloud/utils/db/GlobalLockTest.java
@@ -16,7 +16,8 @@
 // under the License.
 package com.cloud.utils.db;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.springframework.test.context.ContextConfiguration;
@@ -27,7 +28,7 @@
 @RunWith(SpringJUnit4ClassRunner.class)
 @ContextConfiguration(locations = "classpath:/testContext.xml")
 public class GlobalLockTest {
-    public static final Logger s_logger = Logger.getLogger(GlobalLockTest.class);
+    public static final Logger s_logger = LogManager.getLogger(GlobalLockTest.class);
     private final static GlobalLock WorkLock = GlobalLock.getInternLock("SecurityGroupWork");
 
     public static class Worker implements Runnable {
diff --git a/framework/db/test/com/cloud/utils/db/Merovingian2Test.java b/framework/db/test/com/cloud/utils/db/Merovingian2Test.java
index 9d5cf1b84c8..6d4de57b77a 100644
--- a/framework/db/test/com/cloud/utils/db/Merovingian2Test.java
+++ b/framework/db/test/com/cloud/utils/db/Merovingian2Test.java
@@ -19,13 +19,14 @@
 import junit.framework.Assert;
 import junit.framework.TestCase;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
 public class Merovingian2Test extends TestCase {
-    static final Logger s_logger = Logger.getLogger(Merovingian2Test.class);
+    static final Logger s_logger = LogManager.getLogger(Merovingian2Test.class);
     Merovingian2 _lockMaster = Merovingian2.createLockMaster(1234);
 
     @Override
diff --git a/framework/ipc/src/org/apache/cloudstack/framework/async/AsyncCallbackDispatcher.java b/framework/ipc/src/org/apache/cloudstack/framework/async/AsyncCallbackDispatcher.java
index b9aa12bc5b0..61bf2c15660 100644
--- a/framework/ipc/src/org/apache/cloudstack/framework/async/AsyncCallbackDispatcher.java
+++ b/framework/ipc/src/org/apache/cloudstack/framework/async/AsyncCallbackDispatcher.java
@@ -29,11 +29,12 @@
 import net.sf.cglib.proxy.MethodInterceptor;
 import net.sf.cglib.proxy.MethodProxy;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 @SuppressWarnings("rawtypes")
 public class AsyncCallbackDispatcher<T, R> implements AsyncCompletionCallback {
-    private static final Logger s_logger = Logger.getLogger(AsyncCallbackDispatcher.class);
+    private static final Logger s_logger = LogManager.getLogger(AsyncCallbackDispatcher.class);
 
     private Method _callbackMethod;
     private final T _targetObject;
diff --git a/framework/ipc/src/org/apache/cloudstack/framework/client/ClientTransportProvider.java b/framework/ipc/src/org/apache/cloudstack/framework/client/ClientTransportProvider.java
index ae28f900e54..100a3863442 100644
--- a/framework/ipc/src/org/apache/cloudstack/framework/client/ClientTransportProvider.java
+++ b/framework/ipc/src/org/apache/cloudstack/framework/client/ClientTransportProvider.java
@@ -23,7 +23,8 @@
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.framework.serializer.MessageSerializer;
 import org.apache.cloudstack.framework.transport.TransportEndpoint;
@@ -34,7 +35,7 @@
 import com.cloud.utils.concurrency.NamedThreadFactory;
 
 public class ClientTransportProvider implements TransportProvider {
-    final static Logger s_logger = Logger.getLogger(ClientTransportProvider.class);
+    final static Logger s_logger = LogManager.getLogger(ClientTransportProvider.class);
     public static final int DEFAULT_WORKER_POOL_SIZE = 5;
 
     private final Map<Integer, ClientTransportEndpointSite> _endpointSites = new HashMap<Integer, ClientTransportEndpointSite>();
diff --git a/framework/ipc/src/org/apache/cloudstack/framework/messagebus/MessageBusBase.java b/framework/ipc/src/org/apache/cloudstack/framework/messagebus/MessageBusBase.java
index 3579690aa95..97cb2d4376f 100644
--- a/framework/ipc/src/org/apache/cloudstack/framework/messagebus/MessageBusBase.java
+++ b/framework/ipc/src/org/apache/cloudstack/framework/messagebus/MessageBusBase.java
@@ -26,7 +26,8 @@
 import java.util.List;
 import java.util.Map;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.framework.serializer.MessageSerializer;
 
@@ -41,7 +42,7 @@
     private final SubscriptionNode _subscriberRoot;
     private MessageSerializer _messageSerializer;
 
-    private static final Logger s_logger = Logger.getLogger(MessageBusBase.class);
+    private static final Logger s_logger = LogManager.getLogger(MessageBusBase.class);
 
     public MessageBusBase() {
         _gate = new Gate();
diff --git a/framework/ipc/src/org/apache/cloudstack/framework/messagebus/MessageDetector.java b/framework/ipc/src/org/apache/cloudstack/framework/messagebus/MessageDetector.java
index 774b99969aa..d4a5bc4764d 100644
--- a/framework/ipc/src/org/apache/cloudstack/framework/messagebus/MessageDetector.java
+++ b/framework/ipc/src/org/apache/cloudstack/framework/messagebus/MessageDetector.java
@@ -18,10 +18,11 @@
  */
 package org.apache.cloudstack.framework.messagebus;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class MessageDetector implements MessageSubscriber {
-    private static final Logger s_logger = Logger.getLogger(MessageDetector.class);
+    private static final Logger s_logger = LogManager.getLogger(MessageDetector.class);
 
     private MessageBus _messageBus;
     private String[] _subjects;
diff --git a/framework/ipc/src/org/apache/cloudstack/framework/messagebus/MessageDispatcher.java b/framework/ipc/src/org/apache/cloudstack/framework/messagebus/MessageDispatcher.java
index e93bbc2ad4a..abe84d89912 100644
--- a/framework/ipc/src/org/apache/cloudstack/framework/messagebus/MessageDispatcher.java
+++ b/framework/ipc/src/org/apache/cloudstack/framework/messagebus/MessageDispatcher.java
@@ -25,10 +25,11 @@
 import java.util.List;
 import java.util.Map;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class MessageDispatcher implements MessageSubscriber {
-    private static final Logger s_logger = Logger.getLogger(MessageDispatcher.class);
+    private static final Logger s_logger = LogManager.getLogger(MessageDispatcher.class);
 
     private static Map<Class<?>, List<Method>> s_handlerCache = new HashMap<Class<?>, List<Method>>();
 
diff --git a/framework/ipc/src/org/apache/cloudstack/framework/serializer/OnwireClassRegistry.java b/framework/ipc/src/org/apache/cloudstack/framework/serializer/OnwireClassRegistry.java
index de7558734c3..d371a15b873 100644
--- a/framework/ipc/src/org/apache/cloudstack/framework/serializer/OnwireClassRegistry.java
+++ b/framework/ipc/src/org/apache/cloudstack/framework/serializer/OnwireClassRegistry.java
@@ -32,7 +32,8 @@
 import java.util.jar.JarEntry;
 import java.util.jar.JarInputStream;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 
 //
@@ -40,7 +41,7 @@
 // Credit: http://internna.blogspot.com/2007/11/java-5-retrieving-all-classes-from.html
 //
 public class OnwireClassRegistry {
-    private static final Logger s_logger = Logger.getLogger(OnwireClassRegistry.class);
+    private static final Logger s_logger = LogManager.getLogger(OnwireClassRegistry.class);
 
     private List<String> packages = new ArrayList<String>();
     private final Map<String, Class<?>> registry = new HashMap<String, Class<?>>();
diff --git a/framework/ipc/src/org/apache/cloudstack/framework/server/ServerTransportProvider.java b/framework/ipc/src/org/apache/cloudstack/framework/server/ServerTransportProvider.java
index 06215a78b70..ff884c2f2c4 100644
--- a/framework/ipc/src/org/apache/cloudstack/framework/server/ServerTransportProvider.java
+++ b/framework/ipc/src/org/apache/cloudstack/framework/server/ServerTransportProvider.java
@@ -27,7 +27,8 @@
 import org.apache.cloudstack.framework.transport.TransportPdu;
 import org.apache.cloudstack.framework.transport.TransportProvider;
 import org.apache.cloudstack.managed.context.ManagedContextRunnable;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.bouncycastle.jce.provider.BouncyCastleProvider;
 
 import java.security.SecureRandom;
@@ -38,7 +39,7 @@
 import java.util.concurrent.Executors;
 
 public class ServerTransportProvider implements TransportProvider {
-    private static final Logger s_logger = Logger.getLogger(ServerTransportProvider.class);
+    private static final Logger s_logger = LogManager.getLogger(ServerTransportProvider.class);
 
     public static final int DEFAULT_WORKER_POOL_SIZE = 5;
 
diff --git a/framework/ipc/test/org/apache/cloudstack/framework/sampleserver/SampleManagementServer.java b/framework/ipc/test/org/apache/cloudstack/framework/sampleserver/SampleManagementServer.java
index af5862c48e6..aede00ded10 100644
--- a/framework/ipc/test/org/apache/cloudstack/framework/sampleserver/SampleManagementServer.java
+++ b/framework/ipc/test/org/apache/cloudstack/framework/sampleserver/SampleManagementServer.java
@@ -18,10 +18,11 @@
  */
 package org.apache.cloudstack.framework.sampleserver;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class SampleManagementServer {
-    private static final Logger s_logger = Logger.getLogger(SampleManagementServer.class);
+    private static final Logger s_logger = LogManager.getLogger(SampleManagementServer.class);
 
     public void mainLoop() {
         while (true) {
diff --git a/framework/ipc/test/org/apache/cloudstack/framework/sampleserver/SampleManagementServerApp.java b/framework/ipc/test/org/apache/cloudstack/framework/sampleserver/SampleManagementServerApp.java
index 47eb9d94b94..8698d865356 100644
--- a/framework/ipc/test/org/apache/cloudstack/framework/sampleserver/SampleManagementServerApp.java
+++ b/framework/ipc/test/org/apache/cloudstack/framework/sampleserver/SampleManagementServerApp.java
@@ -22,7 +22,6 @@
 import java.net.URISyntaxException;
 import java.net.URL;
 
-import org.apache.log4j.xml.DOMConfigurator;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
@@ -37,7 +36,9 @@ private static void setupLog4j() {
                 File file = new File(configUrl.toURI());
 
                 System.out.println("Log4j configuration from : " + file.getAbsolutePath());
-                DOMConfigurator.configureAndWatch(file.getAbsolutePath(), 10000);
+                org.apache.logging.log4j.core.config.Configurator.initialize("cloud", file.getAbsolutePath());
+                // TODO watch interval must be set in an updated log4j xml*/
+// TODO remove this line            DOMConfigurator.configureAndWatch(file.getAbsolutePath());
             } catch (URISyntaxException e) {
                 System.out.println("Unable to convert log4j configuration Url to URI");
             }
diff --git a/framework/ipc/test/org/apache/cloudstack/framework/sampleserver/SampleManagerComponent.java b/framework/ipc/test/org/apache/cloudstack/framework/sampleserver/SampleManagerComponent.java
index e3abcca9d46..a4d55457808 100644
--- a/framework/ipc/test/org/apache/cloudstack/framework/sampleserver/SampleManagerComponent.java
+++ b/framework/ipc/test/org/apache/cloudstack/framework/sampleserver/SampleManagerComponent.java
@@ -24,7 +24,8 @@
 import javax.annotation.PostConstruct;
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import org.apache.cloudstack.framework.messagebus.MessageBus;
@@ -39,7 +40,7 @@
 
 @Component
 public class SampleManagerComponent {
-    private static final Logger s_logger = Logger.getLogger(SampleManagerComponent.class);
+    private static final Logger s_logger = LogManager.getLogger(SampleManagerComponent.class);
 
     @Inject
     private MessageBus _eventBus;
diff --git a/framework/ipc/test/org/apache/cloudstack/framework/sampleserver/SampleManagerComponent2.java b/framework/ipc/test/org/apache/cloudstack/framework/sampleserver/SampleManagerComponent2.java
index 13040c1c935..a63d37586d1 100644
--- a/framework/ipc/test/org/apache/cloudstack/framework/sampleserver/SampleManagerComponent2.java
+++ b/framework/ipc/test/org/apache/cloudstack/framework/sampleserver/SampleManagerComponent2.java
@@ -21,7 +21,8 @@
 import javax.annotation.PostConstruct;
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import org.apache.cloudstack.framework.messagebus.MessageBus;
@@ -34,7 +35,7 @@
 
 @Component
 public class SampleManagerComponent2 {
-    private static final Logger s_logger = Logger.getLogger(SampleManagerComponent2.class);
+    private static final Logger s_logger = LogManager.getLogger(SampleManagerComponent2.class);
 
     @Inject
     private MessageBus _eventBus;
diff --git a/framework/ipc/test/org/apache/cloudstack/messagebus/TestMessageBus.java b/framework/ipc/test/org/apache/cloudstack/messagebus/TestMessageBus.java
index 3ee48803e29..ed20108097c 100644
--- a/framework/ipc/test/org/apache/cloudstack/messagebus/TestMessageBus.java
+++ b/framework/ipc/test/org/apache/cloudstack/messagebus/TestMessageBus.java
@@ -26,7 +26,8 @@
 import org.apache.cloudstack.framework.messagebus.MessageDetector;
 import org.apache.cloudstack.framework.messagebus.MessageSubscriber;
 import org.apache.cloudstack.framework.messagebus.PublishScope;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.junit.Assert;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -37,7 +38,7 @@
 @RunWith(SpringJUnit4ClassRunner.class)
 @ContextConfiguration(locations = "classpath:/MessageBusTestContext.xml")
 public class TestMessageBus extends TestCase {
-    private static final Logger s_logger = Logger.getLogger(TestMessageBus.class);
+    private static final Logger s_logger = LogManager.getLogger(TestMessageBus.class);
 
     @Inject
     MessageBus _messageBus;
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobExecutionContext.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobExecutionContext.java
index 5575ab394ee..16fb448ebc8 100644
--- a/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobExecutionContext.java
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobExecutionContext.java
@@ -16,7 +16,8 @@
 // under the License.
 package org.apache.cloudstack.framework.jobs;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.context.CallContext;
 import org.apache.cloudstack.framework.jobs.dao.AsyncJobJoinMapDao;
@@ -33,7 +34,7 @@
 import com.cloud.user.User;
 
 public class AsyncJobExecutionContext  {
-    private static final Logger s_logger = Logger.getLogger(AsyncJobExecutionContext.class);
+    private static final Logger s_logger = LogManager.getLogger(AsyncJobExecutionContext.class);
 
     private AsyncJob _job;
 
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobDaoImpl.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobDaoImpl.java
index 0ccd4add19a..91dd04ed3cd 100644
--- a/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobDaoImpl.java
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobDaoImpl.java
@@ -21,7 +21,8 @@
 import java.util.Date;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.framework.jobs.impl.AsyncJobVO;
 import org.apache.cloudstack.jobs.JobInfo;
@@ -35,7 +36,7 @@
 import com.cloud.utils.db.TransactionLegacy;
 
 public class AsyncJobDaoImpl extends GenericDaoBase<AsyncJobVO, Long> implements AsyncJobDao {
-    private static final Logger s_logger = Logger.getLogger(AsyncJobDaoImpl.class.getName());
+    private static final Logger s_logger = LogManager.getLogger(AsyncJobDaoImpl.class.getName());
 
     private final SearchBuilder<AsyncJobVO> pendingAsyncJobSearch;
     private final SearchBuilder<AsyncJobVO> pendingAsyncJobsSearch;
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobJoinMapDaoImpl.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobJoinMapDaoImpl.java
index d70864c755b..24ea5ed9b5c 100644
--- a/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobJoinMapDaoImpl.java
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobJoinMapDaoImpl.java
@@ -24,7 +24,8 @@
 import java.util.List;
 import java.util.TimeZone;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.framework.jobs.impl.AsyncJobJoinMapVO;
 import org.apache.cloudstack.jobs.JobInfo;
@@ -39,7 +40,7 @@
 import com.cloud.utils.exception.CloudRuntimeException;
 
 public class AsyncJobJoinMapDaoImpl extends GenericDaoBase<AsyncJobJoinMapVO, Long> implements AsyncJobJoinMapDao {
-    public static final Logger s_logger = Logger.getLogger(AsyncJobJoinMapDaoImpl.class);
+    public static final Logger s_logger = LogManager.getLogger(AsyncJobJoinMapDaoImpl.class);
 
     private final SearchBuilder<AsyncJobJoinMapVO> RecordSearch;
     private final SearchBuilder<AsyncJobJoinMapVO> RecordSearchByOwner;
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/SyncQueueDaoImpl.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/SyncQueueDaoImpl.java
index 00bd08d0a2a..5ebda9f41a3 100644
--- a/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/SyncQueueDaoImpl.java
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/SyncQueueDaoImpl.java
@@ -22,7 +22,8 @@
 import java.util.Date;
 import java.util.TimeZone;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.framework.jobs.impl.SyncQueueVO;
 
@@ -33,7 +34,7 @@
 import com.cloud.utils.db.TransactionLegacy;
 
 public class SyncQueueDaoImpl extends GenericDaoBase<SyncQueueVO, Long> implements SyncQueueDao {
-    private static final Logger s_logger = Logger.getLogger(SyncQueueDaoImpl.class.getName());
+    private static final Logger s_logger = LogManager.getLogger(SyncQueueDaoImpl.class.getName());
 
     SearchBuilder<SyncQueueVO> TypeIdSearch = createSearchBuilder();
 
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/SyncQueueItemDaoImpl.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/SyncQueueItemDaoImpl.java
index 29c3f1b289f..c380460ef7b 100644
--- a/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/SyncQueueItemDaoImpl.java
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/SyncQueueItemDaoImpl.java
@@ -25,7 +25,8 @@
 import java.util.List;
 import java.util.TimeZone;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.framework.jobs.impl.SyncQueueItemVO;
 
@@ -42,7 +43,7 @@
 
 @DB
 public class SyncQueueItemDaoImpl extends GenericDaoBase<SyncQueueItemVO, Long> implements SyncQueueItemDao {
-    private static final Logger s_logger = Logger.getLogger(SyncQueueItemDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(SyncQueueItemDaoImpl.class);
     final GenericSearchBuilder<SyncQueueItemVO, Long> queueIdSearch;
     final GenericSearchBuilder<SyncQueueItemVO, Integer> queueActiveItemSearch;
 
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/VmWorkJobDaoImpl.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/VmWorkJobDaoImpl.java
index e81ab1ebbf7..3d3985d40cb 100644
--- a/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/VmWorkJobDaoImpl.java
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/VmWorkJobDaoImpl.java
@@ -24,7 +24,8 @@
 import javax.annotation.PostConstruct;
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.framework.jobs.impl.VmWorkJobVO;
 import org.apache.cloudstack.framework.jobs.impl.VmWorkJobVO.Step;
@@ -43,7 +44,7 @@
 import com.cloud.vm.VirtualMachine;
 
 public class VmWorkJobDaoImpl extends GenericDaoBase<VmWorkJobVO, Long> implements VmWorkJobDao {
-    private static final Logger s_logger = Logger.getLogger(VmWorkJobDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(VmWorkJobDaoImpl.class);
 
     protected SearchBuilder<VmWorkJobVO> PendingWorkJobSearch;
     protected SearchBuilder<VmWorkJobVO> PendingWorkJobByCommandSearch;
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
index 7f2e1567d7a..20e5ed00ce5 100644
--- a/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
@@ -33,10 +33,9 @@
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
+import com.cloud.storage.dao.VolumeDao;
 import com.cloud.storage.dao.VolumeDetailsDao;
 import org.apache.cloudstack.api.ApiCommandJobType;
-import org.apache.log4j.Logger;
-import org.apache.log4j.NDC;
 import org.apache.cloudstack.api.ApiErrorCode;
 import org.apache.cloudstack.context.CallContext;
 import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotDataFactory;
@@ -59,7 +58,6 @@
 import org.apache.cloudstack.jobs.JobInfo.Status;
 import org.apache.cloudstack.managed.context.ManagedContextRunnable;
 import org.apache.cloudstack.utils.identity.ManagementServerNode;
-import org.slf4j.MDC;
 
 import com.cloud.cluster.ClusterManagerListener;
 import com.cloud.cluster.ManagementServerHost;
@@ -92,7 +90,10 @@
 import com.cloud.utils.exception.ExceptionUtil;
 import com.cloud.utils.mgmt.JmxUtil;
 import com.cloud.vm.dao.VMInstanceDao;
-import com.cloud.storage.dao.VolumeDao;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.ThreadContext;
 
 public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager, ClusterManagerListener, Configurable {
     // Advanced
@@ -104,7 +105,7 @@
             Integer.class, "vm.job.lock.timeout", "1800",
             "Time in seconds to wait in acquiring lock to submit a vm worker job", false);
 
-    private static final Logger s_logger = Logger.getLogger(AsyncJobManagerImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(AsyncJobManagerImpl.class);
 
     private static final int ACQUIRE_GLOBAL_LOCK_TIMEOUT_FOR_COOPERATION = 3;     // 3 seconds
 
@@ -512,19 +513,19 @@ public void run() {
                 String related = job.getRelated();
                 String logContext = job.getShortUuid();
                 if (related != null && !related.isEmpty()) {
-                    NDC.push("job-" + related + "/" + "job-" + job.getId());
+                    ThreadContext.push("job-" + related + "/" + "job-" + job.getId());
                     AsyncJob relatedJob = _jobDao.findByIdIncludingRemoved(Long.parseLong(related));
                     if (relatedJob != null) {
                         logContext = relatedJob.getShortUuid();
                     }
                 } else {
-                    NDC.push("job-" + job.getId());
+                    ThreadContext.push("job-" + job.getId());
                 }
-                MDC.put("logcontextid", logContext);
+                ThreadContext.put("logcontextid", logContext);
                 try {
                     super.run();
                 } finally {
-                    NDC.pop();
+                    ThreadContext.pop();
                 }
             }
 
@@ -555,7 +556,7 @@ protected void runInContext() {
                             logContext = relatedJob.getShortUuid();
                         }
                     }
-                    MDC.put("logcontextid", logContext);
+                    ThreadContext.put("logcontextid", logContext);
 
                     // execute the job
                     if (s_logger.isDebugEnabled()) {
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobMonitor.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobMonitor.java
index b1cac3e79a5..bc27b0ea46b 100644
--- a/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobMonitor.java
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobMonitor.java
@@ -25,7 +25,8 @@
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.framework.jobs.AsyncJob;
 import org.apache.cloudstack.framework.jobs.AsyncJobManager;
@@ -37,7 +38,7 @@
 import com.cloud.utils.component.ManagerBase;
 
 public class AsyncJobMonitor extends ManagerBase {
-    public static final Logger s_logger = Logger.getLogger(AsyncJobMonitor.class);
+    public static final Logger s_logger = LogManager.getLogger(AsyncJobMonitor.class);
 
     @Inject private MessageBus _messageBus;
 
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/JobSerializerHelper.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/JobSerializerHelper.java
index 735d7cf73e2..1e5283103a7 100644
--- a/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/JobSerializerHelper.java
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/JobSerializerHelper.java
@@ -27,7 +27,8 @@
 import java.lang.reflect.Type;
 
 import org.apache.commons.codec.binary.Base64;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.google.gson.Gson;
@@ -45,7 +46,7 @@
  * Note: toPairList and appendPairList only support simple POJO objects currently
  */
 public class JobSerializerHelper {
-    private static final Logger s_logger = Logger.getLogger(JobSerializerHelper.class);
+    private static final Logger s_logger = LogManager.getLogger(JobSerializerHelper.class);
     public static final String token = "/";
 
     private static Gson s_gson;
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/SyncQueueManagerImpl.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/SyncQueueManagerImpl.java
index 2f97991e3e3..e152c0ef81b 100644
--- a/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/SyncQueueManagerImpl.java
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/SyncQueueManagerImpl.java
@@ -22,7 +22,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.framework.jobs.dao.SyncQueueDao;
 import org.apache.cloudstack.framework.jobs.dao.SyncQueueItemDao;
@@ -36,7 +37,7 @@
 import com.cloud.utils.exception.CloudRuntimeException;
 
 public class SyncQueueManagerImpl extends ManagerBase implements SyncQueueManager {
-    public static final Logger s_logger = Logger.getLogger(SyncQueueManagerImpl.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(SyncQueueManagerImpl.class.getName());
 
     @Inject
     private SyncQueueDao _syncQueueDao;
diff --git a/framework/jobs/test/org/apache/cloudstack/framework/jobs/AsyncJobManagerTest.java b/framework/jobs/test/org/apache/cloudstack/framework/jobs/AsyncJobManagerTest.java
index a49f28ef55d..ceca3d63f7c 100644
--- a/framework/jobs/test/org/apache/cloudstack/framework/jobs/AsyncJobManagerTest.java
+++ b/framework/jobs/test/org/apache/cloudstack/framework/jobs/AsyncJobManagerTest.java
@@ -26,7 +26,7 @@
 @ContextConfiguration(locations = "classpath:/AsyncJobManagerTestContext.xml")
 public class AsyncJobManagerTest extends TestCase {
     private static final Logger s_logger =
-            Logger.getLogger(AsyncJobManagerTest.class);
+            LogManager.getLogger(AsyncJobManagerTest.class);
 
     @Inject
     AsyncJobManager _jobMgr;
diff --git a/framework/jobs/test/org/apache/cloudstack/framework/jobs/AsyncJobTestDispatcher.java b/framework/jobs/test/org/apache/cloudstack/framework/jobs/AsyncJobTestDispatcher.java
index eb30a804978..73706783d87 100644
--- a/framework/jobs/test/org/apache/cloudstack/framework/jobs/AsyncJobTestDispatcher.java
+++ b/framework/jobs/test/org/apache/cloudstack/framework/jobs/AsyncJobTestDispatcher.java
@@ -20,7 +20,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.jobs.JobInfo.Status;
 
@@ -28,7 +29,7 @@
 
 public class AsyncJobTestDispatcher extends AdapterBase implements AsyncJobDispatcher {
     private static final Logger s_logger =
-            Logger.getLogger(AsyncJobTestDispatcher.class);
+            LogManager.getLogger(AsyncJobTestDispatcher.class);
 
     @Inject
     private AsyncJobManager _asyncJobMgr;
diff --git a/framework/managed-context/pom.xml b/framework/managed-context/pom.xml
index 9140753a85b..95be553a3d4 100644
--- a/framework/managed-context/pom.xml
+++ b/framework/managed-context/pom.xml
@@ -29,8 +29,8 @@
   </parent>
   <dependencies>
       <dependency>
-          <groupId>org.slf4j</groupId>
-          <artifactId>slf4j-api</artifactId>
+          <groupId>org.apache.logging.log4j</groupId>
+          <artifactId>log4j-api</artifactId>
       </dependency>
   </dependencies>
 </project>
diff --git a/framework/managed-context/src/main/java/org/apache/cloudstack/managed/context/ManagedContextRunnable.java b/framework/managed-context/src/main/java/org/apache/cloudstack/managed/context/ManagedContextRunnable.java
index b4a9758420b..a46e5d65431 100644
--- a/framework/managed-context/src/main/java/org/apache/cloudstack/managed/context/ManagedContextRunnable.java
+++ b/framework/managed-context/src/main/java/org/apache/cloudstack/managed/context/ManagedContextRunnable.java
@@ -18,8 +18,8 @@
  */
 package org.apache.cloudstack.managed.context;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 import org.apache.cloudstack.managed.context.impl.DefaultManagedContext;
 
@@ -27,7 +27,7 @@
 
     private static final int SLEEP_COUNT = 120;
 
-    private static final Logger log = LoggerFactory.getLogger(ManagedContextRunnable.class);
+    private static final Logger log = LogManager.getLogger(ManagedContextRunnable.class);
     private static final ManagedContext DEFAULT_MANAGED_CONTEXT = new DefaultManagedContext();
     private static ManagedContext context;
     private static boolean managedContext = false;
diff --git a/framework/managed-context/src/main/java/org/apache/cloudstack/managed/context/impl/DefaultManagedContext.java b/framework/managed-context/src/main/java/org/apache/cloudstack/managed/context/impl/DefaultManagedContext.java
index 34c83b1d332..20ff6e48a82 100644
--- a/framework/managed-context/src/main/java/org/apache/cloudstack/managed/context/impl/DefaultManagedContext.java
+++ b/framework/managed-context/src/main/java/org/apache/cloudstack/managed/context/impl/DefaultManagedContext.java
@@ -23,17 +23,16 @@
 import java.util.concurrent.Callable;
 import java.util.concurrent.CopyOnWriteArrayList;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import org.apache.cloudstack.managed.context.ManagedContext;
 import org.apache.cloudstack.managed.context.ManagedContextListener;
 import org.apache.cloudstack.managed.context.ManagedContextUtils;
 import org.apache.cloudstack.managed.threadlocal.ManagedThreadLocal;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 public class DefaultManagedContext implements ManagedContext {
 
-    private static final Logger log = LoggerFactory.getLogger(DefaultManagedContext.class);
+    private static final Logger log = LogManager.getLogger(DefaultManagedContext.class);
 
     List<ManagedContextListener<?>> listeners = new CopyOnWriteArrayList<ManagedContextListener<?>>();
 
diff --git a/framework/managed-context/src/main/java/org/apache/cloudstack/managed/threadlocal/ManagedThreadLocal.java b/framework/managed-context/src/main/java/org/apache/cloudstack/managed/threadlocal/ManagedThreadLocal.java
index 2db3aafcf5c..99964393230 100644
--- a/framework/managed-context/src/main/java/org/apache/cloudstack/managed/threadlocal/ManagedThreadLocal.java
+++ b/framework/managed-context/src/main/java/org/apache/cloudstack/managed/threadlocal/ManagedThreadLocal.java
@@ -21,8 +21,8 @@
 import java.util.HashMap;
 import java.util.Map;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
 import org.apache.cloudstack.managed.context.ManagedContextUtils;
 
@@ -36,7 +36,7 @@
     };
 
     private static boolean s_validateContext = false;
-    private static final Logger log = LoggerFactory.getLogger(ManagedThreadLocal.class);
+    private static final Logger log = LogManager.getLogger(ManagedThreadLocal.class);
 
     @SuppressWarnings("unchecked")
     @Override
diff --git a/framework/quota/src/org/apache/cloudstack/quota/QuotaAlertManagerImpl.java b/framework/quota/src/org/apache/cloudstack/quota/QuotaAlertManagerImpl.java
index b31af52c00c..880930d9308 100644
--- a/framework/quota/src/org/apache/cloudstack/quota/QuotaAlertManagerImpl.java
+++ b/framework/quota/src/org/apache/cloudstack/quota/QuotaAlertManagerImpl.java
@@ -40,7 +40,8 @@
 import org.apache.cloudstack.quota.vo.QuotaAccountVO;
 import org.apache.cloudstack.quota.vo.QuotaEmailTemplatesVO;
 import org.apache.commons.lang3.text.StrSubstitutor;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import javax.ejb.Local;
@@ -66,7 +67,7 @@
 @Component
 @Local(value = QuotaAlertManager.class)
 public class QuotaAlertManagerImpl extends ManagerBase implements QuotaAlertManager {
-    private static final Logger s_logger = Logger.getLogger(QuotaAlertManagerImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(QuotaAlertManagerImpl.class);
 
     @Inject
     private AccountDao _accountDao;
diff --git a/framework/quota/src/org/apache/cloudstack/quota/QuotaManagerImpl.java b/framework/quota/src/org/apache/cloudstack/quota/QuotaManagerImpl.java
index 7f592f85cb3..6c3bacc5f25 100644
--- a/framework/quota/src/org/apache/cloudstack/quota/QuotaManagerImpl.java
+++ b/framework/quota/src/org/apache/cloudstack/quota/QuotaManagerImpl.java
@@ -36,7 +36,8 @@
 import org.apache.cloudstack.quota.vo.QuotaUsageVO;
 import org.apache.cloudstack.quota.vo.ServiceOfferingVO;
 import org.apache.cloudstack.utils.usage.UsageUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import javax.ejb.Local;
@@ -53,7 +54,7 @@
 @Component
 @Local(value = QuotaManager.class)
 public class QuotaManagerImpl extends ManagerBase implements QuotaManager {
-    private static final Logger s_logger = Logger.getLogger(QuotaManagerImpl.class.getName());
+    private static final Logger s_logger = LogManager.getLogger(QuotaManagerImpl.class.getName());
 
     @Inject
     private AccountDao _accountDao;
diff --git a/framework/quota/src/org/apache/cloudstack/quota/QuotaStatementImpl.java b/framework/quota/src/org/apache/cloudstack/quota/QuotaStatementImpl.java
index 30d2589187e..a30836ceada 100644
--- a/framework/quota/src/org/apache/cloudstack/quota/QuotaStatementImpl.java
+++ b/framework/quota/src/org/apache/cloudstack/quota/QuotaStatementImpl.java
@@ -34,7 +34,8 @@
 import org.apache.cloudstack.quota.dao.QuotaAccountDao;
 import org.apache.cloudstack.quota.dao.QuotaUsageDao;
 import org.apache.cloudstack.quota.vo.QuotaAccountVO;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.user.AccountVO;
@@ -44,7 +45,7 @@
 @Component
 @Local(value = QuotaStatement.class)
 public class QuotaStatementImpl extends ManagerBase implements QuotaStatement {
-    private static final Logger s_logger = Logger.getLogger(QuotaStatementImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(QuotaStatementImpl.class);
 
     @Inject
     private AccountDao _accountDao;
diff --git a/framework/quota/src/org/apache/cloudstack/quota/dao/QuotaAccountDaoImpl.java b/framework/quota/src/org/apache/cloudstack/quota/dao/QuotaAccountDaoImpl.java
index e3de1889de9..fdce677a212 100644
--- a/framework/quota/src/org/apache/cloudstack/quota/dao/QuotaAccountDaoImpl.java
+++ b/framework/quota/src/org/apache/cloudstack/quota/dao/QuotaAccountDaoImpl.java
@@ -23,7 +23,8 @@
 import com.cloud.utils.db.TransactionStatus;
 
 import org.apache.cloudstack.quota.vo.QuotaAccountVO;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import javax.ejb.Local;
@@ -33,7 +34,7 @@
 @Component
 @Local(value = { QuotaAccountDao.class })
 public class QuotaAccountDaoImpl extends GenericDaoBase<QuotaAccountVO, Long> implements QuotaAccountDao {
-    public static final Logger s_logger = Logger.getLogger(QuotaAccountDaoImpl.class);
+    public static final Logger s_logger = LogManager.getLogger(QuotaAccountDaoImpl.class);
 
     public List<QuotaAccountVO> listAllQuotaAccount() {
         return Transaction.execute(TransactionLegacy.USAGE_DB, new TransactionCallback<List<QuotaAccountVO>>() {
diff --git a/framework/quota/src/org/apache/cloudstack/quota/dao/QuotaBalanceDaoImpl.java b/framework/quota/src/org/apache/cloudstack/quota/dao/QuotaBalanceDaoImpl.java
index d8ce7acc97d..7a416ffd32b 100644
--- a/framework/quota/src/org/apache/cloudstack/quota/dao/QuotaBalanceDaoImpl.java
+++ b/framework/quota/src/org/apache/cloudstack/quota/dao/QuotaBalanceDaoImpl.java
@@ -26,7 +26,8 @@
 import com.cloud.utils.db.TransactionStatus;
 
 import org.apache.cloudstack.quota.vo.QuotaBalanceVO;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import javax.ejb.Local;
@@ -40,7 +41,7 @@
 @Component
 @Local(value = {QuotaBalanceDao.class})
 public class QuotaBalanceDaoImpl extends GenericDaoBase<QuotaBalanceVO, Long> implements QuotaBalanceDao {
-    private static final Logger s_logger = Logger.getLogger(QuotaBalanceDaoImpl.class.getName());
+    private static final Logger s_logger = LogManager.getLogger(QuotaBalanceDaoImpl.class.getName());
 
     public QuotaBalanceVO findLastBalanceEntry(final Long accountId, final Long domainId, final Date beforeThis) {
         return Transaction.execute(TransactionLegacy.USAGE_DB, new TransactionCallback<QuotaBalanceVO>() {
diff --git a/framework/quota/src/org/apache/cloudstack/quota/dao/QuotaEmailTemplatesDaoImpl.java b/framework/quota/src/org/apache/cloudstack/quota/dao/QuotaEmailTemplatesDaoImpl.java
index a971603c577..5db88d06d34 100644
--- a/framework/quota/src/org/apache/cloudstack/quota/dao/QuotaEmailTemplatesDaoImpl.java
+++ b/framework/quota/src/org/apache/cloudstack/quota/dao/QuotaEmailTemplatesDaoImpl.java
@@ -26,7 +26,8 @@
 import com.google.common.base.Strings;
 
 import org.apache.cloudstack.quota.vo.QuotaEmailTemplatesVO;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import javax.ejb.Local;
@@ -36,7 +37,7 @@
 @Component
 @Local(value = { QuotaEmailTemplatesDao.class })
 public class QuotaEmailTemplatesDaoImpl extends GenericDaoBase<QuotaEmailTemplatesVO, Long> implements QuotaEmailTemplatesDao {
-    private static final Logger s_logger = Logger.getLogger(QuotaEmailTemplatesDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(QuotaEmailTemplatesDaoImpl.class);
 
     protected SearchBuilder<QuotaEmailTemplatesVO> QuotaEmailTemplateSearch;
 
diff --git a/framework/quota/src/org/apache/cloudstack/quota/dao/QuotaTariffDaoImpl.java b/framework/quota/src/org/apache/cloudstack/quota/dao/QuotaTariffDaoImpl.java
index 294b404d928..c9f3e7ce52a 100644
--- a/framework/quota/src/org/apache/cloudstack/quota/dao/QuotaTariffDaoImpl.java
+++ b/framework/quota/src/org/apache/cloudstack/quota/dao/QuotaTariffDaoImpl.java
@@ -26,7 +26,8 @@
 import com.cloud.utils.db.TransactionStatus;
 import org.apache.cloudstack.quota.constant.QuotaTypes;
 import org.apache.cloudstack.quota.vo.QuotaTariffVO;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import javax.ejb.Local;
@@ -38,7 +39,7 @@
 @Component
 @Local(value = {QuotaTariffDao.class})
 public class QuotaTariffDaoImpl extends GenericDaoBase<QuotaTariffVO, Long> implements QuotaTariffDao {
-    private static final Logger s_logger = Logger.getLogger(QuotaTariffDaoImpl.class.getName());
+    private static final Logger s_logger = LogManager.getLogger(QuotaTariffDaoImpl.class.getName());
 
     private final SearchBuilder<QuotaTariffVO> searchUsageType;
     private final SearchBuilder<QuotaTariffVO> listAllIncludedUsageType;
diff --git a/framework/quota/src/org/apache/cloudstack/quota/dao/QuotaUsageDaoImpl.java b/framework/quota/src/org/apache/cloudstack/quota/dao/QuotaUsageDaoImpl.java
index 8c0fae6391e..cb0a8e2f937 100644
--- a/framework/quota/src/org/apache/cloudstack/quota/dao/QuotaUsageDaoImpl.java
+++ b/framework/quota/src/org/apache/cloudstack/quota/dao/QuotaUsageDaoImpl.java
@@ -26,7 +26,8 @@
 import com.cloud.utils.db.TransactionStatus;
 
 import org.apache.cloudstack.quota.vo.QuotaUsageVO;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import javax.ejb.Local;
@@ -39,7 +40,7 @@
 @Component
 @Local(value = {QuotaUsageDao.class})
 public class QuotaUsageDaoImpl extends GenericDaoBase<QuotaUsageVO, Long> implements QuotaUsageDao {
-    private static final Logger s_logger = Logger.getLogger(QuotaUsageDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(QuotaUsageDaoImpl.class);
 
     public BigDecimal findTotalQuotaUsage(final Long accountId, final Long domainId, final Integer usageType, final Date startDate, final Date endDate) {
         List<QuotaUsageVO> quotaUsage = findQuotaUsage(accountId, domainId, null, startDate, endDate);
diff --git a/framework/quota/src/org/apache/cloudstack/quota/dao/ServiceOfferingDaoImpl.java b/framework/quota/src/org/apache/cloudstack/quota/dao/ServiceOfferingDaoImpl.java
index 1d8b1b6b648..9d6240c818c 100644
--- a/framework/quota/src/org/apache/cloudstack/quota/dao/ServiceOfferingDaoImpl.java
+++ b/framework/quota/src/org/apache/cloudstack/quota/dao/ServiceOfferingDaoImpl.java
@@ -21,7 +21,8 @@
 import javax.ejb.Local;
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 import org.apache.cloudstack.quota.vo.ServiceOfferingVO;
 
@@ -38,7 +39,7 @@
 @Local(value = {ServiceOfferingDao.class})
 @DB()
 public class ServiceOfferingDaoImpl extends GenericDaoBase<ServiceOfferingVO, Long> implements ServiceOfferingDao {
-    protected static final Logger s_logger = Logger.getLogger(ServiceOfferingDaoImpl.class);
+    protected static final Logger s_logger = LogManager.getLogger(ServiceOfferingDaoImpl.class);
 
     @Inject
     UserVmDetailsDao userVmDetailsDao;
diff --git a/framework/security/src/org/apache/cloudstack/framework/security/keys/KeysManagerImpl.java b/framework/security/src/org/apache/cloudstack/framework/security/keys/KeysManagerImpl.java
index 15bb49c65ff..9f343f9331d 100644
--- a/framework/security/src/org/apache/cloudstack/framework/security/keys/KeysManagerImpl.java
+++ b/framework/security/src/org/apache/cloudstack/framework/security/keys/KeysManagerImpl.java
@@ -23,7 +23,8 @@
 import javax.net.ssl.KeyManager;
 
 import org.apache.commons.codec.binary.Base64;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.framework.config.ConfigDepot;
 import org.apache.cloudstack.framework.config.ConfigKey;
@@ -50,7 +51,7 @@
  *
  */
 public class KeysManagerImpl implements KeysManager, Configurable {
-    private static final Logger s_logger = Logger.getLogger(KeysManagerImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(KeysManagerImpl.class);
 
     @Inject
     ConfigurationDao _configDao;
diff --git a/framework/security/src/org/apache/cloudstack/framework/security/keystore/KeystoreManagerImpl.java b/framework/security/src/org/apache/cloudstack/framework/security/keystore/KeystoreManagerImpl.java
index bed74bf4c3e..888969a3d8d 100644
--- a/framework/security/src/org/apache/cloudstack/framework/security/keystore/KeystoreManagerImpl.java
+++ b/framework/security/src/org/apache/cloudstack/framework/security/keystore/KeystoreManagerImpl.java
@@ -32,7 +32,8 @@
 
 import com.google.common.base.Strings;
 import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.utils.Ternary;
@@ -42,7 +43,7 @@
 
 @Component
 public class KeystoreManagerImpl extends ManagerBase implements KeystoreManager {
-    private static final Logger s_logger = Logger.getLogger(KeystoreManagerImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(KeystoreManagerImpl.class);
 
     @Inject
     private KeystoreDao _ksDao;
diff --git a/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/CloudStackExtendedLifeCycle.java b/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/CloudStackExtendedLifeCycle.java
index fd9c886604c..4e555fbd0a0 100644
--- a/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/CloudStackExtendedLifeCycle.java
+++ b/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/CloudStackExtendedLifeCycle.java
@@ -29,18 +29,17 @@
 import javax.management.NotCompliantMBeanException;
 import javax.naming.ConfigurationException;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import com.cloud.utils.component.ComponentLifecycle;
 import com.cloud.utils.component.SystemIntegrityChecker;
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.mgmt.JmxUtil;
 import com.cloud.utils.mgmt.ManagementBean;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class CloudStackExtendedLifeCycle extends AbstractBeanCollector {
 
-    private static final Logger log = LoggerFactory.getLogger(CloudStackExtendedLifeCycle.class);
+    private static final Logger log = LogManager.getLogger(CloudStackExtendedLifeCycle.class);
 
     Map<Integer, Set<ComponentLifecycle>> sorted = new TreeMap<Integer, Set<ComponentLifecycle>>();
 
diff --git a/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/registry/DumpRegistry.java b/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/registry/DumpRegistry.java
index 79e35f11d0c..5d4c28bf188 100644
--- a/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/registry/DumpRegistry.java
+++ b/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/registry/DumpRegistry.java
@@ -22,16 +22,15 @@
 
 import javax.inject.Inject;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import com.cloud.utils.component.ComponentLifecycleBase;
 import com.cloud.utils.component.Named;
 import com.cloud.utils.component.Registry;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class DumpRegistry extends ComponentLifecycleBase {
 
-    private static final Logger log = LoggerFactory.getLogger(DumpRegistry.class);
+    private static final Logger log = LogManager.getLogger(DumpRegistry.class);
 
     List<Registry<?>> registries;
 
diff --git a/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/registry/ExtensionRegistry.java b/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/registry/ExtensionRegistry.java
index 321e365e2c1..0d96362f741 100644
--- a/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/registry/ExtensionRegistry.java
+++ b/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/registry/ExtensionRegistry.java
@@ -27,19 +27,17 @@
 
 import javax.annotation.PostConstruct;
 
-import org.apache.commons.lang.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.BeanNameAware;
-
+import com.cloud.utils.component.Registry;
 import org.apache.cloudstack.framework.config.ConfigKey;
 import org.apache.cloudstack.framework.config.Configurable;
-
-import com.cloud.utils.component.Registry;
+import org.apache.commons.lang.StringUtils;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.springframework.beans.factory.BeanNameAware;
 
 public class ExtensionRegistry implements Registry<Object>, Configurable, BeanNameAware {
 
-    private static final Logger log = LoggerFactory.getLogger(ExtensionRegistry.class);
+    private static final Logger log = LogManager.getLogger(ExtensionRegistry.class);
 
     String name;
     String beanName;
diff --git a/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/registry/RegistryLifecycle.java b/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/registry/RegistryLifecycle.java
index 337cfbdc52b..5bc0d50c272 100644
--- a/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/registry/RegistryLifecycle.java
+++ b/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/registry/RegistryLifecycle.java
@@ -23,8 +23,9 @@
 import java.util.Properties;
 import java.util.Set;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import com.cloud.utils.component.Registry;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.beans.BeansException;
 import org.springframework.beans.factory.config.BeanPostProcessor;
 import org.springframework.context.ApplicationContext;
@@ -32,11 +33,9 @@
 import org.springframework.context.SmartLifecycle;
 import org.springframework.util.StringUtils;
 
-import com.cloud.utils.component.Registry;
-
 public class RegistryLifecycle implements BeanPostProcessor, SmartLifecycle, ApplicationContextAware {
 
-    private static final Logger log = LoggerFactory.getLogger(RegistryLifecycle.class);
+    private static final Logger log = LogManager.getLogger(RegistryLifecycle.class);
 
     public static final String EXTENSION_EXCLUDE = "extensions.exclude";
     public static final String EXTENSION_INCLUDE_PREFIX = "extensions.include.";
diff --git a/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/factory/CloudStackSpringContext.java b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/factory/CloudStackSpringContext.java
index 26525dea582..4f1dc7d0418 100644
--- a/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/factory/CloudStackSpringContext.java
+++ b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/factory/CloudStackSpringContext.java
@@ -24,20 +24,19 @@
 import java.util.List;
 import java.util.Map;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.core.io.Resource;
-
 import org.apache.cloudstack.spring.module.locator.ModuleDefinitionLocator;
 import org.apache.cloudstack.spring.module.locator.impl.ClasspathModuleDefinitionLocator;
 import org.apache.cloudstack.spring.module.model.ModuleDefinition;
 import org.apache.cloudstack.spring.module.model.ModuleDefinitionSet;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ConfigurableApplicationContext;
+import org.springframework.core.io.Resource;
 
 public class CloudStackSpringContext {
 
-    private static final Logger log = LoggerFactory.getLogger(CloudStackSpringContext.class);
+    private static final Logger log = LogManager.getLogger(CloudStackSpringContext.class);
 
     public static final String CLOUDSTACK_CONTEXT_SERVLET_KEY = CloudStackSpringContext.class.getSimpleName();
     public static final String CLOUDSTACK_CONTEXT = "META-INF/cloudstack";
diff --git a/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/model/impl/DefaultModuleDefinitionSet.java b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/model/impl/DefaultModuleDefinitionSet.java
index bba0dccc53c..63a09d1e879 100644
--- a/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/model/impl/DefaultModuleDefinitionSet.java
+++ b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/model/impl/DefaultModuleDefinitionSet.java
@@ -32,9 +32,12 @@
 import java.util.Set;
 import java.util.Stack;
 
+import org.apache.cloudstack.spring.module.context.ResourceApplicationContext;
+import org.apache.cloudstack.spring.module.model.ModuleDefinition;
+import org.apache.cloudstack.spring.module.model.ModuleDefinitionSet;
 import org.apache.commons.io.IOUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.beans.BeansException;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.annotation.Bean;
@@ -43,13 +46,9 @@
 import org.springframework.core.io.UrlResource;
 import org.springframework.util.StringUtils;
 
-import org.apache.cloudstack.spring.module.context.ResourceApplicationContext;
-import org.apache.cloudstack.spring.module.model.ModuleDefinition;
-import org.apache.cloudstack.spring.module.model.ModuleDefinitionSet;
-
 public class DefaultModuleDefinitionSet implements ModuleDefinitionSet {
 
-    private static final Logger log = LoggerFactory.getLogger(DefaultModuleDefinitionSet.class);
+    private static final Logger log = LogManager.getLogger(DefaultModuleDefinitionSet.class);
 
     public static final String DEFAULT_CONFIG_RESOURCES = "DefaultConfigResources";
     public static final String DEFAULT_CONFIG_PROPERTIES = "DefaultConfigProperties";
diff --git a/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/web/CloudStackContextLoaderListener.java b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/web/CloudStackContextLoaderListener.java
index bf6fb24d6a4..57e11843f45 100644
--- a/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/web/CloudStackContextLoaderListener.java
+++ b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/web/CloudStackContextLoaderListener.java
@@ -23,8 +23,8 @@
 import javax.servlet.ServletContext;
 import javax.servlet.ServletContextEvent;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.context.ApplicationContext;
 import org.springframework.web.context.ConfigurableWebApplicationContext;
 import org.springframework.web.context.ContextLoaderListener;
@@ -36,7 +36,7 @@
     public static final String WEB_PARENT_MODULE = "parentModule";
     public static final String WEB_PARENT_MODULE_DEFAULT = "web";
 
-    private static final Logger log = LoggerFactory.getLogger(CloudStackContextLoaderListener.class);
+    private static final Logger log = LogManager.getLogger(CloudStackContextLoaderListener.class);
 
     CloudStackSpringContext cloudStackContext;
     String configuredParentName;
diff --git a/plugins/acl/static-role-based/src/org/apache/cloudstack/acl/StaticRoleBasedAPIAccessChecker.java b/plugins/acl/static-role-based/src/org/apache/cloudstack/acl/StaticRoleBasedAPIAccessChecker.java
index fc78268fc62..1fa1a1380b5 100644
--- a/plugins/acl/static-role-based/src/org/apache/cloudstack/acl/StaticRoleBasedAPIAccessChecker.java
+++ b/plugins/acl/static-role-based/src/org/apache/cloudstack/acl/StaticRoleBasedAPIAccessChecker.java
@@ -25,7 +25,8 @@
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 
@@ -41,7 +42,7 @@
 // based on the account type, access is granted
 public class StaticRoleBasedAPIAccessChecker extends AdapterBase implements APIChecker {
 
-    protected static final Logger LOGGER = Logger.getLogger(StaticRoleBasedAPIAccessChecker.class);
+    protected static final Logger LOGGER = LogManager.getLogger(StaticRoleBasedAPIAccessChecker.class);
 
     private Set<String> commandPropertyFiles = new HashSet<String>();
     private Set<String> commandsPropertiesOverrides = new HashSet<String>();
diff --git a/plugins/affinity-group-processors/explicit-dedication/src/org/apache/cloudstack/affinity/ExplicitDedicationProcessor.java b/plugins/affinity-group-processors/explicit-dedication/src/org/apache/cloudstack/affinity/ExplicitDedicationProcessor.java
index 905890493d2..a30871de36f 100644
--- a/plugins/affinity-group-processors/explicit-dedication/src/org/apache/cloudstack/affinity/ExplicitDedicationProcessor.java
+++ b/plugins/affinity-group-processors/explicit-dedication/src/org/apache/cloudstack/affinity/ExplicitDedicationProcessor.java
@@ -24,7 +24,8 @@
 
 import org.apache.cloudstack.affinity.dao.AffinityGroupDao;
 import org.apache.cloudstack.affinity.dao.AffinityGroupVMMapDao;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.dc.ClusterVO;
 import com.cloud.dc.DataCenter;
@@ -56,7 +57,7 @@
 
 public class ExplicitDedicationProcessor extends AffinityProcessorBase implements AffinityGroupProcessor {
 
-    private static final Logger s_logger = Logger.getLogger(ExplicitDedicationProcessor.class);
+    private static final Logger s_logger = LogManager.getLogger(ExplicitDedicationProcessor.class);
     @Inject
     protected UserVmDao _vmDao;
     @Inject
diff --git a/plugins/affinity-group-processors/host-anti-affinity/src/org/apache/cloudstack/affinity/HostAntiAffinityProcessor.java b/plugins/affinity-group-processors/host-anti-affinity/src/org/apache/cloudstack/affinity/HostAntiAffinityProcessor.java
index 0af118ff548..5922a71985e 100644
--- a/plugins/affinity-group-processors/host-anti-affinity/src/org/apache/cloudstack/affinity/HostAntiAffinityProcessor.java
+++ b/plugins/affinity-group-processors/host-anti-affinity/src/org/apache/cloudstack/affinity/HostAntiAffinityProcessor.java
@@ -22,7 +22,8 @@
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.affinity.dao.AffinityGroupDao;
 import org.apache.cloudstack.affinity.dao.AffinityGroupVMMapDao;
@@ -45,7 +46,7 @@
 
 public class HostAntiAffinityProcessor extends AffinityProcessorBase implements AffinityGroupProcessor {
 
-    private static final Logger s_logger = Logger.getLogger(HostAntiAffinityProcessor.class);
+    private static final Logger s_logger = LogManager.getLogger(HostAntiAffinityProcessor.class);
     @Inject
     protected UserVmDao _vmDao;
     @Inject
diff --git a/plugins/alert-handlers/snmp-alerts/pom.xml b/plugins/alert-handlers/snmp-alerts/pom.xml
index 95d8833a5e8..01bf658be88 100644
--- a/plugins/alert-handlers/snmp-alerts/pom.xml
+++ b/plugins/alert-handlers/snmp-alerts/pom.xml
@@ -35,8 +35,8 @@
       <artifactId>org.apache.servicemix.bundles.snmp4j</artifactId>
     </dependency>
     <dependency>
-      <groupId>log4j</groupId>
-      <artifactId>log4j</artifactId>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-api</artifactId>
     </dependency>
   </dependencies>
 
diff --git a/plugins/alert-handlers/snmp-alerts/src/org/apache/cloudstack/alert/snmp/SnmpEnhancedPatternLayout.java b/plugins/alert-handlers/snmp-alerts/src/org/apache/cloudstack/alert/snmp/SnmpEnhancedPatternLayout.java
index 73fa7f68ba7..24ef78f4f42 100644
--- a/plugins/alert-handlers/snmp-alerts/src/org/apache/cloudstack/alert/snmp/SnmpEnhancedPatternLayout.java
+++ b/plugins/alert-handlers/snmp-alerts/src/org/apache/cloudstack/alert/snmp/SnmpEnhancedPatternLayout.java
@@ -20,16 +20,21 @@
 import java.util.Date;
 import java.util.StringTokenizer;
 
-import org.apache.log4j.EnhancedPatternLayout;
-import org.apache.log4j.spi.LoggingEvent;
+import org.apache.logging.log4j.core.LogEvent;
+import org.apache.logging.log4j.core.config.Configuration;
+import org.apache.logging.log4j.core.layout.AbstractLayout;
 
-public class SnmpEnhancedPatternLayout extends EnhancedPatternLayout {
+public class SnmpEnhancedPatternLayout extends AbstractLayout<SnmpTrapInfo> {
     private String _pairDelimiter = "//";
     private String _keyValueDelimiter = "::";
 
     private static final int LENGTH_OF_STRING_MESSAGE_AND_KEY_VALUE_DELIMITER = 9;
     private static final int LENGTH_OF_STRING_MESSAGE = 8;
 
+    public SnmpEnhancedPatternLayout(Configuration configuration, byte[] header, byte[] footer) {
+        super(configuration, header, footer);
+    }
+
     public String getKeyValueDelimeter() {
         return _keyValueDelimiter;
     }
@@ -46,10 +51,10 @@ public void setPairDelimiter(String pairDelimiter) {
         this._pairDelimiter = pairDelimiter;
     }
 
-    public SnmpTrapInfo parseEvent(LoggingEvent event) {
+    public SnmpTrapInfo parseEvent(LogEvent event) {
         SnmpTrapInfo snmpTrapInfo = null;
 
-        final String message = event.getRenderedMessage();
+        final String message = event.getMessage().getFormattedMessage();
         if (message.contains("alertType") && message.contains("message")) {
             snmpTrapInfo = new SnmpTrapInfo();
             final StringTokenizer messageSplitter = new StringTokenizer(message, _pairDelimiter);
@@ -84,7 +89,7 @@ public SnmpTrapInfo parseEvent(LoggingEvent event) {
                 }
             }
 
-            snmpTrapInfo.setGenerationTime(new Date(event.getTimeStamp()));
+            snmpTrapInfo.setGenerationTime(new Date(event.getTimeMillis()));
         }
         return snmpTrapInfo;
     }
@@ -101,4 +106,19 @@ private String getSnmpMessage(String message) {
 
         return message.substring(message.lastIndexOf("message" + _keyValueDelimiter) + LENGTH_OF_STRING_MESSAGE_AND_KEY_VALUE_DELIMITER).trim();
     }
+
+    @Override
+    public byte[] toByteArray(LogEvent logEvent) {
+        return new byte[0];
+    }
+
+    @Override
+    public SnmpTrapInfo toSerializable(LogEvent logEvent) {
+        return parseEvent(logEvent);
+    }
+
+    @Override
+    public String getContentType() {
+        return "application/snmp";
+    }
 }
\ No newline at end of file
diff --git a/plugins/alert-handlers/snmp-alerts/src/org/apache/cloudstack/alert/snmp/SnmpTrapAppender.java b/plugins/alert-handlers/snmp-alerts/src/org/apache/cloudstack/alert/snmp/SnmpTrapAppender.java
index 3579e245c18..6ae5ca2a715 100644
--- a/plugins/alert-handlers/snmp-alerts/src/org/apache/cloudstack/alert/snmp/SnmpTrapAppender.java
+++ b/plugins/alert-handlers/snmp-alerts/src/org/apache/cloudstack/alert/snmp/SnmpTrapAppender.java
@@ -17,17 +17,18 @@
 
 package org.apache.cloudstack.alert.snmp;
 
+import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.StringTokenizer;
 
-import org.apache.log4j.AppenderSkeleton;
-import org.apache.log4j.spi.ErrorCode;
-import org.apache.log4j.spi.LoggingEvent;
-
 import com.cloud.utils.net.NetUtils;
+import org.apache.logging.log4j.core.Filter;
+import org.apache.logging.log4j.core.Layout;
+import org.apache.logging.log4j.core.LogEvent;
+import org.apache.logging.log4j.core.appender.AbstractAppender;
 
-public class SnmpTrapAppender extends AppenderSkeleton {
+public class SnmpTrapAppender extends AbstractAppender {
     private String _delimiter = ",";
     private String _snmpManagerIpAddresses;
     private String _snmpManagerPorts;
@@ -43,12 +44,16 @@
 
     List<SnmpHelper> _snmpHelpers = new ArrayList<SnmpHelper>();
 
+    protected SnmpTrapAppender(String name, Filter filter, Layout<? extends Serializable> layout) {
+        super(name, filter, layout);
+    }
+
     @Override
-    protected void append(LoggingEvent event) {
+    public void append(LogEvent event) {
         SnmpEnhancedPatternLayout snmpEnhancedPatternLayout;
 
         if (getLayout() == null) {
-            errorHandler.error("No layout set for the Appender named [" + getName() + ']', null, ErrorCode.MISSING_LAYOUT);
+            getHandler().error("No layout set for the Appender named [" + getName() + ']');
             return;
         }
 
@@ -58,7 +63,7 @@ protected void append(LoggingEvent event) {
             return;
         }
 
-        if (!isAsSevereAsThreshold(event.getLevel())) {
+        if (isFiltered(event)) {
             return;
         }
 
@@ -69,7 +74,7 @@ protected void append(LoggingEvent event) {
                 try {
                     helper.sendSnmpTrap(snmpTrapInfo);
                 } catch (Exception e) {
-                    errorHandler.error(e.getMessage());
+                    getHandler().error(e.getMessage());
                 }
             }
         }
@@ -97,13 +102,13 @@ void setSnmpHelpers() {
 
         if (!(_ipAddresses.size() == _communities.size() && _ipAddresses.size() == _ports.size())) {
             reset();
-            errorHandler.error(" size of ip addresses , communities, " + "and ports list doesn't match, " + "setting all to null");
+            getHandler().error(" size of ip addresses , communities, " + "and ports list doesn't match, " + "setting all to null");
             return;
         }
 
         if (!validateIpAddresses() || !validatePorts()) {
             reset();
-            errorHandler.error(" Invalid format for the IP Addresses or Ports parameter ");
+            getHandler().error(" Invalid format for the IP Addresses or Ports parameter ");
             return;
         }
 
@@ -114,7 +119,7 @@ void setSnmpHelpers() {
             try {
                 _snmpHelpers.add(new SnmpHelper(address, _communities.get(i)));
             } catch (Exception e) {
-                errorHandler.error(e.getMessage());
+                getHandler().error(e.getMessage());
             }
         }
     }
@@ -126,17 +131,6 @@ private void reset() {
         _snmpHelpers.clear();
     }
 
-    @Override
-    public void close() {
-        if (!closed)
-            closed = true;
-    }
-
-    @Override
-    public boolean requiresLayout() {
-        return true;
-    }
-
     private List<String> parse(String str) {
         List<String> result = new ArrayList<String>();
 
diff --git a/plugins/alert-handlers/snmp-alerts/src/org/apache/cloudstack/alert/snmp/SnmpTrapInfo.java b/plugins/alert-handlers/snmp-alerts/src/org/apache/cloudstack/alert/snmp/SnmpTrapInfo.java
index 9d410d46663..6de6c6c05ab 100644
--- a/plugins/alert-handlers/snmp-alerts/src/org/apache/cloudstack/alert/snmp/SnmpTrapInfo.java
+++ b/plugins/alert-handlers/snmp-alerts/src/org/apache/cloudstack/alert/snmp/SnmpTrapInfo.java
@@ -17,9 +17,10 @@
 
 package org.apache.cloudstack.alert.snmp;
 
+import java.io.Serializable;
 import java.util.Date;
 
-public class SnmpTrapInfo {
+public class SnmpTrapInfo implements Serializable {
     private String message;
     private long podId;
     private long dataCenterId;
diff --git a/plugins/alert-handlers/snmp-alerts/test/org/apache/cloudstack/alert/snmp/SnmpEnhancedPatternLayoutTest.java b/plugins/alert-handlers/snmp-alerts/test/org/apache/cloudstack/alert/snmp/SnmpEnhancedPatternLayoutTest.java
index 7aa6adfc203..1ff4a0eb9ea 100644
--- a/plugins/alert-handlers/snmp-alerts/test/org/apache/cloudstack/alert/snmp/SnmpEnhancedPatternLayoutTest.java
+++ b/plugins/alert-handlers/snmp-alerts/test/org/apache/cloudstack/alert/snmp/SnmpEnhancedPatternLayoutTest.java
@@ -17,58 +17,67 @@
 
 package org.apache.cloudstack.alert.snmp;
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertNull;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.spi.LoggingEvent;
+import org.apache.logging.log4j.core.LogEvent;
+import org.apache.logging.log4j.core.config.Configuration;
+import org.apache.logging.log4j.core.config.DefaultConfiguration;
+import org.apache.logging.log4j.message.Message;
 import org.junit.Before;
 import org.junit.Test;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertNotNull;
+import static junit.framework.Assert.assertNull;
+import static org.mockito.Mockito.when;
 
 public class SnmpEnhancedPatternLayoutTest {
-    SnmpEnhancedPatternLayout _snmpEnhancedPatternLayout = new SnmpEnhancedPatternLayout();
+    Configuration configuration = new DefaultConfiguration();
+    SnmpEnhancedPatternLayout _snmpEnhancedPatternLayout = new SnmpEnhancedPatternLayout(configuration, null, null);
+    @Mock
+    LogEvent event;
+    @Mock
+    Message messageObject;
 
     @Before
     public void setUp() throws ConfigurationException {
+        MockitoAnnotations.initMocks(this);
+
+        when(event.getMessage()).thenReturn(messageObject);
+
         _snmpEnhancedPatternLayout.setKeyValueDelimiter("::");
         _snmpEnhancedPatternLayout.setPairDelimiter("//");
     }
 
     @Test
     public void parseAlertTest() {
-        LoggingEvent event = mock(LoggingEvent.class);
         setMessage(" alertType:: 14 // dataCenterId:: 1 // podId:: 1 // " + "clusterId:: null // message:: Management"
-            + " network CIDR is not configured originally. Set it default to 10.102.192.0/22", event);
+            + " network CIDR is not configured originally. Set it default to 10.102.192.0/22");
         SnmpTrapInfo info = _snmpEnhancedPatternLayout.parseEvent(event);
         commonAssertions(info, "Management network CIDR is not configured originally. Set it default to 10.102.192" + ".0/22");
     }
 
     @Test
     public void ParseAlertWithPairDelimeterInMessageTest() {
-        LoggingEvent event = mock(LoggingEvent.class);
         setMessage(" alertType:: 14 // dataCenterId:: 1 // podId:: 1 // " + "clusterId:: null // message:: Management"
-            + " //network CIDR is not configured originally. Set it default to 10.102.192.0/22", event);
+            + " //network CIDR is not configured originally. Set it default to 10.102.192.0/22");
         SnmpTrapInfo info = _snmpEnhancedPatternLayout.parseEvent(event);
         commonAssertions(info, "Management //network CIDR is not configured originally. Set it default to 10.102.192" + ".0/22");
     }
 
     @Test
     public void ParseAlertWithKeyValueDelimeterInMessageTest() {
-        LoggingEvent event = mock(LoggingEvent.class);
         setMessage(" alertType:: 14 // dataCenterId:: 1 // podId:: 1 // " + "clusterId:: null // message:: Management"
-            + " ::network CIDR is not configured originally. Set it default to 10.102.192.0/22", event);
+            + " ::network CIDR is not configured originally. Set it default to 10.102.192.0/22");
         SnmpTrapInfo info = _snmpEnhancedPatternLayout.parseEvent(event);
         commonAssertions(info, "Management ::network CIDR is not configured originally. Set it default to 10.102.192" + ".0/22");
     }
 
     @Test
     public void parseRandomTest() {
-        LoggingEvent event = mock(LoggingEvent.class);
-        when(event.getRenderedMessage()).thenReturn("Problem clearing email alert");
+        when(event.getMessage().getFormattedMessage()).thenReturn("Problem clearing email alert");
         assertNull(" Null value was expected ", _snmpEnhancedPatternLayout.parseEvent(event));
     }
 
@@ -81,7 +90,7 @@ private void commonAssertions(SnmpTrapInfo info, String message) {
         assertEquals(" message is not as expected ", message, info.getMessage());
     }
 
-    private void setMessage(String message, LoggingEvent event) {
-        when(event.getRenderedMessage()).thenReturn(message);
+    private void setMessage(String message) {
+        when(messageObject.getFormattedMessage()).thenReturn(message);
     }
 }
\ No newline at end of file
diff --git a/plugins/alert-handlers/snmp-alerts/test/org/apache/cloudstack/alert/snmp/SnmpTrapAppenderTest.java b/plugins/alert-handlers/snmp-alerts/test/org/apache/cloudstack/alert/snmp/SnmpTrapAppenderTest.java
index 7db30730071..c13af016334 100644
--- a/plugins/alert-handlers/snmp-alerts/test/org/apache/cloudstack/alert/snmp/SnmpTrapAppenderTest.java
+++ b/plugins/alert-handlers/snmp-alerts/test/org/apache/cloudstack/alert/snmp/SnmpTrapAppenderTest.java
@@ -17,19 +17,19 @@
 
 package org.apache.cloudstack.alert.snmp;
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertTrue;
-import static org.mockito.Mockito.mock;
-
 import java.util.List;
 
-import org.apache.log4j.spi.LoggingEvent;
+import org.apache.logging.log4j.core.LogEvent;
 import org.junit.Test;
 import org.mockito.Mock;
 
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
+
 public class SnmpTrapAppenderTest {
-    SnmpTrapAppender _appender = new SnmpTrapAppender();
-    LoggingEvent _event = mock(LoggingEvent.class);
+    SnmpTrapAppender _appender = new SnmpTrapAppender("SnmpTrapAppender",null, null);
+    LogEvent _event = mock(LogEvent.class);
     SnmpEnhancedPatternLayout _snmpEnhancedPatternLayout = mock(SnmpEnhancedPatternLayout.class);
     @Mock
     List<SnmpHelper> snmpHelpers;
diff --git a/plugins/alert-handlers/syslog-alerts/pom.xml b/plugins/alert-handlers/syslog-alerts/pom.xml
index 1b5858460a0..aba98e827b6 100644
--- a/plugins/alert-handlers/syslog-alerts/pom.xml
+++ b/plugins/alert-handlers/syslog-alerts/pom.xml
@@ -31,8 +31,8 @@
 
   <dependencies>
     <dependency>
-      <groupId>log4j</groupId>
-      <artifactId>log4j</artifactId>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-api</artifactId>
     </dependency>
   </dependencies>
 
diff --git a/plugins/alert-handlers/syslog-alerts/src/org/apache/cloudstack/syslog/AlertsSyslogAppender.java b/plugins/alert-handlers/syslog-alerts/src/org/apache/cloudstack/syslog/AlertsSyslogAppender.java
index 7324c200882..e6d5232b227 100644
--- a/plugins/alert-handlers/syslog-alerts/src/org/apache/cloudstack/syslog/AlertsSyslogAppender.java
+++ b/plugins/alert-handlers/syslog-alerts/src/org/apache/cloudstack/syslog/AlertsSyslogAppender.java
@@ -17,6 +17,7 @@
 
 package org.apache.cloudstack.syslog;
 
+import java.io.Serializable;
 import java.net.InetAddress;
 import java.net.UnknownHostException;
 import java.util.ArrayList;
@@ -26,13 +27,21 @@
 import java.util.Map;
 import java.util.StringTokenizer;
 
-import org.apache.log4j.AppenderSkeleton;
-import org.apache.log4j.net.SyslogAppender;
-import org.apache.log4j.spi.LoggingEvent;
-
 import com.cloud.utils.net.NetUtils;
-
-public class AlertsSyslogAppender extends AppenderSkeleton {
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.core.Layout;
+import org.apache.logging.log4j.core.LogEvent;
+import org.apache.logging.log4j.core.appender.AbstractAppender;
+import org.apache.logging.log4j.core.appender.SyslogAppender;
+import org.apache.logging.log4j.core.config.Configuration;
+import org.apache.logging.log4j.core.config.DefaultConfiguration;
+import org.apache.logging.log4j.core.filter.ThresholdFilter;
+import org.apache.logging.log4j.core.impl.Log4jLogEvent;
+import org.apache.logging.log4j.core.net.Facility;
+import org.apache.logging.log4j.message.Message;
+import org.apache.logging.log4j.message.MessageFormatMessage;
+
+public class AlertsSyslogAppender extends AbstractAppender {
     String _syslogHosts = null;
     String _delimiter = ",";
     List<String> _syslogHostsList = null;
@@ -50,7 +59,7 @@
     public static final String MESSAGE_DELIMITER_STRING = "   ";
     //add the alertType in this array it its level needs to be set to critical
     private static final int[] criticalAlerts = {7, 8, 9, 10, 11, 12, 13, 15, 16, 19, 20, 27};
-    private static final Map<Integer, String> alertsMap;
+    static final Map<Integer, String> alertsMap;
 
     static {
         Map<Integer, String> aMap = new HashMap<Integer, String>(27);
@@ -86,42 +95,37 @@
         alertsMap = Collections.unmodifiableMap(aMap);
     }
 
+    protected AlertsSyslogAppender(String name, Layout<? extends Serializable> layout) {
+            super(name, ThresholdFilter.createFilter(Level.TRACE, null, null), layout);
+    }
+
     @Override
-    protected void append(LoggingEvent event) {
-        if (!isAsSevereAsThreshold(event.getLevel())) {
+    public void append(LogEvent event) {
+        if (isFiltered(event)) {
             return;
         }
 
         if (_syslogAppenders != null && !_syslogAppenders.isEmpty()) {
             try {
-                String logMessage = event.getRenderedMessage();
+                String logMessage = event.getMessage().getFormattedMessage();
                 if (logMessage.contains("alertType") && logMessage.contains("message")) {
                     parseMessage(logMessage);
                     String syslogMessage = createSyslogMessage();
+                    // TODO this might need another type of message
+                    Message passOnMessage = new MessageFormatMessage(syslogMessage);
 
-                    LoggingEvent syslogEvent = new LoggingEvent(event.getFQNOfLoggerClass(), event.getLogger(), event.getLevel(), syslogMessage, null);
+                    LogEvent syslogEvent = new Log4jLogEvent(event.getLoggerName(), null, event.getLoggerFqcn(), event.getLevel(), passOnMessage, null, event.getThrown());
 
                     for (SyslogAppender syslogAppender : _syslogAppenders) {
                         syslogAppender.append(syslogEvent);
                     }
                 }
             } catch (Exception e) {
-                errorHandler.error(e.getMessage());
+                getHandler().error(e.getMessage());
             }
         }
     }
 
-    @Override
-    synchronized public void close() {
-        for (SyslogAppender syslogAppender : _syslogAppenders) {
-            syslogAppender.close();
-        }
-    }
-
-    @Override
-    public boolean requiresLayout() {
-        return true;
-    }
 
     void setSyslogAppenders() {
         if (_syslogAppenders == null) {
@@ -137,12 +141,18 @@ void setSyslogAppenders() {
 
         if (!validateIpAddresses()) {
             reset();
-            errorHandler.error(" Invalid format for the IP Addresses parameter ");
+            getHandler().error(" Invalid format for the IP Addresses parameter ");
             return;
         }
 
         for (String syslogHost : _syslogHostsList) {
-            _syslogAppenders.add(new SyslogAppender(getLayout(), syslogHost, SyslogAppender.getFacility(_facility)));
+            SyslogAppender.Builder builder = SyslogAppender.newSyslogAppenderBuilder();
+            builder.setAppName(getName());
+            builder.setFacility(Facility.toFacility(getFacility()));
+            Configuration configuration = new DefaultConfiguration();
+
+            SyslogAppender app = builder.build();
+            _syslogAppenders.add(app);
         }
     }
 
@@ -248,10 +258,10 @@ String createSyslogMessage() {
             if (sysMessage != null) {
                 message.append("message").append(_keyValueDelimiter).append(" ").append(sysMessage);
             } else {
-                errorHandler.error("What is the use of alert without message ");
+                getHandler().error("What is the use of alert without message ");
             }
         } else {
-            errorHandler.error("Invalid alert Type ");
+            getHandler().error("Invalid alert Type ");
         }
 
         return message.toString();
@@ -282,7 +292,9 @@ public void setFacility(String facility) {
         _facility = facility;
         if (_syslogAppenders != null && !_syslogAppenders.isEmpty()) {
             for (SyslogAppender syslogAppender : _syslogAppenders) {
-                syslogAppender.setFacility(facility);
+
+                // TODO Double check this functionaly; probably won't work :(
+//                syslogAppender.setLayout(this.getLayout());
             }
         }
     }
diff --git a/plugins/alert-handlers/syslog-alerts/test/org/apache/cloudstack/syslog/AlertsSyslogAppenderTest.java b/plugins/alert-handlers/syslog-alerts/test/org/apache/cloudstack/syslog/AlertsSyslogAppenderTest.java
index 7b7dbe0ada4..686e522c4dd 100644
--- a/plugins/alert-handlers/syslog-alerts/test/org/apache/cloudstack/syslog/AlertsSyslogAppenderTest.java
+++ b/plugins/alert-handlers/syslog-alerts/test/org/apache/cloudstack/syslog/AlertsSyslogAppenderTest.java
@@ -17,21 +17,22 @@
 
 package org.apache.cloudstack.syslog;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.PatternLayout;
+import org.apache.logging.log4j.core.layout.PatternLayout;
 import org.junit.Before;
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
 public class AlertsSyslogAppenderTest {
-    AlertsSyslogAppender _appender = new AlertsSyslogAppender();
+    AlertsSyslogAppender _appender = new AlertsSyslogAppender("testAppender",
+        PatternLayout.newBuilder().withPattern("%-5p [%c{3}] (%t:%x) %m%n").build());
+    // laste param pattern was new PatternLayout(,"%-5p [%c{3}] (%t:%x) %m%n"));
 
     @Before
     public void setUp() throws ConfigurationException {
-        _appender.setLayout(new PatternLayout("%-5p [%c{3}] (%t:%x) %m%n"));
         _appender.setFacility("LOCAL6");
     }
 
diff --git a/plugins/api/discovery/src/org/apache/cloudstack/api/command/user/discovery/ListApisCmd.java b/plugins/api/discovery/src/org/apache/cloudstack/api/command/user/discovery/ListApisCmd.java
index 66d8c5d64e3..2aed04119ed 100644
--- a/plugins/api/discovery/src/org/apache/cloudstack/api/command/user/discovery/ListApisCmd.java
+++ b/plugins/api/discovery/src/org/apache/cloudstack/api/command/user/discovery/ListApisCmd.java
@@ -19,7 +19,8 @@
 import javax.inject.Inject;
 
 import org.apache.cloudstack.acl.RoleType;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -42,7 +43,7 @@
             responseHasSensitiveInfo = false, authorized = {RoleType.Admin, RoleType.ResourceAdmin, RoleType.DomainAdmin, RoleType.User})
 public class ListApisCmd extends BaseCmd {
 
-    public static final Logger s_logger = Logger.getLogger(ListApisCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListApisCmd.class.getName());
     private static final String s_name = "listapisresponse";
 
     @Inject
diff --git a/plugins/api/discovery/src/org/apache/cloudstack/discovery/ApiDiscoveryServiceImpl.java b/plugins/api/discovery/src/org/apache/cloudstack/discovery/ApiDiscoveryServiceImpl.java
index 3408a77b850..085e16477e9 100644
--- a/plugins/api/discovery/src/org/apache/cloudstack/discovery/ApiDiscoveryServiceImpl.java
+++ b/plugins/api/discovery/src/org/apache/cloudstack/discovery/ApiDiscoveryServiceImpl.java
@@ -26,7 +26,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.google.gson.annotations.SerializedName;
@@ -53,7 +54,7 @@
 
 @Component
 public class ApiDiscoveryServiceImpl extends ComponentLifecycleBase implements ApiDiscoveryService {
-    private static final Logger s_logger = Logger.getLogger(ApiDiscoveryServiceImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(ApiDiscoveryServiceImpl.class);
 
     List<APIChecker> _apiAccessCheckers = null;
     List<PluggableService> _services = null;
diff --git a/plugins/api/rate-limit/src/org/apache/cloudstack/api/command/admin/ratelimit/ResetApiLimitCmd.java b/plugins/api/rate-limit/src/org/apache/cloudstack/api/command/admin/ratelimit/ResetApiLimitCmd.java
index fab68e3856c..b31f4e8efec 100644
--- a/plugins/api/rate-limit/src/org/apache/cloudstack/api/command/admin/ratelimit/ResetApiLimitCmd.java
+++ b/plugins/api/rate-limit/src/org/apache/cloudstack/api/command/admin/ratelimit/ResetApiLimitCmd.java
@@ -18,7 +18,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.ACL;
 import org.apache.cloudstack.api.APICommand;
@@ -40,7 +41,7 @@
 @APICommand(name = "resetApiLimit", responseObject = ApiLimitResponse.class, description = "Reset api count",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ResetApiLimitCmd extends BaseCmd {
-    private static final Logger s_logger = Logger.getLogger(ResetApiLimitCmd.class.getName());
+    private static final Logger s_logger = LogManager.getLogger(ResetApiLimitCmd.class.getName());
 
     private static final String s_name = "resetapilimitresponse";
 
diff --git a/plugins/api/rate-limit/src/org/apache/cloudstack/api/command/user/ratelimit/GetApiLimitCmd.java b/plugins/api/rate-limit/src/org/apache/cloudstack/api/command/user/ratelimit/GetApiLimitCmd.java
index 51b2064fa90..57c96986b83 100644
--- a/plugins/api/rate-limit/src/org/apache/cloudstack/api/command/user/ratelimit/GetApiLimitCmd.java
+++ b/plugins/api/rate-limit/src/org/apache/cloudstack/api/command/user/ratelimit/GetApiLimitCmd.java
@@ -18,7 +18,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiErrorCode;
@@ -35,7 +36,7 @@
 @APICommand(name = "getApiLimit", responseObject = ApiLimitResponse.class, description = "Get API limit count for the caller",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class GetApiLimitCmd extends BaseCmd {
-    private static final Logger s_logger = Logger.getLogger(GetApiLimitCmd.class.getName());
+    private static final Logger s_logger = LogManager.getLogger(GetApiLimitCmd.class.getName());
 
     private static final String s_name = "getapilimitresponse";
 
diff --git a/plugins/api/rate-limit/src/org/apache/cloudstack/ratelimit/ApiRateLimitServiceImpl.java b/plugins/api/rate-limit/src/org/apache/cloudstack/ratelimit/ApiRateLimitServiceImpl.java
index e35a332c54d..0acd62fad69 100644
--- a/plugins/api/rate-limit/src/org/apache/cloudstack/ratelimit/ApiRateLimitServiceImpl.java
+++ b/plugins/api/rate-limit/src/org/apache/cloudstack/ratelimit/ApiRateLimitServiceImpl.java
@@ -26,7 +26,8 @@
 import net.sf.ehcache.Cache;
 import net.sf.ehcache.CacheManager;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import org.apache.cloudstack.acl.APIChecker;
@@ -45,7 +46,7 @@
 
 @Component
 public class ApiRateLimitServiceImpl extends AdapterBase implements APIChecker, ApiRateLimitService {
-    private static final Logger s_logger = Logger.getLogger(ApiRateLimitServiceImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(ApiRateLimitServiceImpl.class);
 
     /**
      * True if api rate limiting is enabled
diff --git a/plugins/api/solidfire-intg-test/src/org/apache/cloudstack/api/command/admin/solidfire/GetPathForVolumeCmd.java b/plugins/api/solidfire-intg-test/src/org/apache/cloudstack/api/command/admin/solidfire/GetPathForVolumeCmd.java
index 5ff178a2e92..f3d59842baa 100644
--- a/plugins/api/solidfire-intg-test/src/org/apache/cloudstack/api/command/admin/solidfire/GetPathForVolumeCmd.java
+++ b/plugins/api/solidfire-intg-test/src/org/apache/cloudstack/api/command/admin/solidfire/GetPathForVolumeCmd.java
@@ -18,7 +18,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.BaseCmd;
@@ -29,7 +30,7 @@
 @APICommand(name = "getPathForVolume", responseObject = ApiPathForVolumeResponse.class, description = "Get the path associated with the provided volume UUID",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class GetPathForVolumeCmd extends BaseCmd {
-    private static final Logger LOGGER = Logger.getLogger(GetPathForVolumeCmd.class.getName());
+    private static final Logger LOGGER = LogManager.getLogger(GetPathForVolumeCmd.class.getName());
     private static final String NAME = "getpathforvolumeresponse";
 
     @Parameter(name = ApiConstants.VOLUME_ID, type = CommandType.STRING, description = "CloudStack Volume UUID", required = true)
diff --git a/plugins/api/solidfire-intg-test/src/org/apache/cloudstack/api/command/admin/solidfire/GetSolidFireAccountIdCmd.java b/plugins/api/solidfire-intg-test/src/org/apache/cloudstack/api/command/admin/solidfire/GetSolidFireAccountIdCmd.java
index 9bb8481c3c4..73ff516d5ee 100644
--- a/plugins/api/solidfire-intg-test/src/org/apache/cloudstack/api/command/admin/solidfire/GetSolidFireAccountIdCmd.java
+++ b/plugins/api/solidfire-intg-test/src/org/apache/cloudstack/api/command/admin/solidfire/GetSolidFireAccountIdCmd.java
@@ -18,7 +18,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.APICommand;
@@ -31,7 +32,7 @@
 @APICommand(name = "getSolidFireAccountId", responseObject = ApiSolidFireAccountIdResponse.class, description = "Get SolidFire Account ID",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class GetSolidFireAccountIdCmd extends BaseCmd {
-    private static final Logger LOGGER = Logger.getLogger(GetSolidFireAccountIdCmd.class.getName());
+    private static final Logger LOGGER = LogManager.getLogger(GetSolidFireAccountIdCmd.class.getName());
     private static final String NAME = "getsolidfireaccountidresponse";
 
     @Parameter(name = ApiConstants.ACCOUNT_ID, type = CommandType.STRING, description = "CloudStack Account UUID", required = true)
diff --git a/plugins/api/solidfire-intg-test/src/org/apache/cloudstack/api/command/admin/solidfire/GetSolidFireVolumeAccessGroupIdCmd.java b/plugins/api/solidfire-intg-test/src/org/apache/cloudstack/api/command/admin/solidfire/GetSolidFireVolumeAccessGroupIdCmd.java
index 5c15e01a30b..1463fcde882 100644
--- a/plugins/api/solidfire-intg-test/src/org/apache/cloudstack/api/command/admin/solidfire/GetSolidFireVolumeAccessGroupIdCmd.java
+++ b/plugins/api/solidfire-intg-test/src/org/apache/cloudstack/api/command/admin/solidfire/GetSolidFireVolumeAccessGroupIdCmd.java
@@ -20,7 +20,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.APICommand;
@@ -34,7 +35,7 @@
 @APICommand(name = "getSolidFireVolumeAccessGroupId", responseObject = ApiSolidFireVolumeAccessGroupIdResponse.class, description = "Get the SF Volume Access Group ID",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class GetSolidFireVolumeAccessGroupIdCmd extends BaseCmd {
-    private static final Logger LOGGER = Logger.getLogger(GetSolidFireVolumeAccessGroupIdCmd.class.getName());
+    private static final Logger LOGGER = LogManager.getLogger(GetSolidFireVolumeAccessGroupIdCmd.class.getName());
     private static final String NAME = "getsolidfirevolumeaccessgroupidresponse";
 
     @Parameter(name = ApiConstants.CLUSTER_ID, type = CommandType.STRING, description = "Cluster UUID", required = true)
diff --git a/plugins/api/solidfire-intg-test/src/org/apache/cloudstack/api/command/admin/solidfire/GetSolidFireVolumeSizeCmd.java b/plugins/api/solidfire-intg-test/src/org/apache/cloudstack/api/command/admin/solidfire/GetSolidFireVolumeSizeCmd.java
index d7c8acfe378..3faaf051af4 100644
--- a/plugins/api/solidfire-intg-test/src/org/apache/cloudstack/api/command/admin/solidfire/GetSolidFireVolumeSizeCmd.java
+++ b/plugins/api/solidfire-intg-test/src/org/apache/cloudstack/api/command/admin/solidfire/GetSolidFireVolumeSizeCmd.java
@@ -18,7 +18,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.APICommand;
@@ -31,7 +32,7 @@
 @APICommand(name = "getSolidFireVolumeSize", responseObject = ApiSolidFireVolumeSizeResponse.class, description = "Get the SF volume size including Hypervisor Snapshot Reserve",
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class GetSolidFireVolumeSizeCmd extends BaseCmd {
-    private static final Logger LOGGER = Logger.getLogger(GetSolidFireVolumeSizeCmd.class.getName());
+    private static final Logger LOGGER = LogManager.getLogger(GetSolidFireVolumeSizeCmd.class.getName());
     private static final String NAME = "getsolidfirevolumesizeresponse";
 
     @Parameter(name = ApiConstants.VOLUME_ID, type = CommandType.STRING, description = "Volume UUID", required = true)
diff --git a/plugins/api/solidfire-intg-test/src/org/apache/cloudstack/api/command/admin/solidfire/GetVolumeSnapshotDetailsCmd.java b/plugins/api/solidfire-intg-test/src/org/apache/cloudstack/api/command/admin/solidfire/GetVolumeSnapshotDetailsCmd.java
index 5b9ce373328..7f223ebf0ca 100644
--- a/plugins/api/solidfire-intg-test/src/org/apache/cloudstack/api/command/admin/solidfire/GetVolumeSnapshotDetailsCmd.java
+++ b/plugins/api/solidfire-intg-test/src/org/apache/cloudstack/api/command/admin/solidfire/GetVolumeSnapshotDetailsCmd.java
@@ -20,7 +20,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.BaseCmd;
@@ -34,7 +35,7 @@
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 
 public class GetVolumeSnapshotDetailsCmd extends BaseCmd {
-    private static final Logger LOGGER = Logger.getLogger(GetVolumeSnapshotDetailsCmd.class.getName());
+    private static final Logger LOGGER = LogManager.getLogger(GetVolumeSnapshotDetailsCmd.class.getName());
     private static final String NAME = "getvolumesnapshotdetailsresponse";
 
     @Parameter(name = ApiConstants.SNAPSHOT_ID, type = CommandType.STRING, description = "CloudStack Snapshot UUID", required = true)
diff --git a/plugins/api/solidfire-intg-test/src/org/apache/cloudstack/api/command/admin/solidfire/GetVolumeiScsiNameCmd.java b/plugins/api/solidfire-intg-test/src/org/apache/cloudstack/api/command/admin/solidfire/GetVolumeiScsiNameCmd.java
index dd6992caf36..d301e42cc6a 100644
--- a/plugins/api/solidfire-intg-test/src/org/apache/cloudstack/api/command/admin/solidfire/GetVolumeiScsiNameCmd.java
+++ b/plugins/api/solidfire-intg-test/src/org/apache/cloudstack/api/command/admin/solidfire/GetVolumeiScsiNameCmd.java
@@ -18,7 +18,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.BaseCmd;
@@ -30,7 +31,7 @@
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 
 public class GetVolumeiScsiNameCmd extends BaseCmd {
-    private static final Logger LOGGER = Logger.getLogger(GetVolumeiScsiNameCmd.class.getName());
+    private static final Logger LOGGER = LogManager.getLogger(GetVolumeiScsiNameCmd.class.getName());
     private static final String NAME = "getvolumeiscsinameresponse";
 
     @Parameter(name = ApiConstants.VOLUME_ID, type = CommandType.STRING, description = "CloudStack Volume UUID", required = true)
diff --git a/plugins/api/solidfire-intg-test/src/org/apache/cloudstack/api/solidfire/ApiSolidFireIntegrationTestServiceImpl.java b/plugins/api/solidfire-intg-test/src/org/apache/cloudstack/api/solidfire/ApiSolidFireIntegrationTestServiceImpl.java
index 04589038d34..624d0d5c64f 100644
--- a/plugins/api/solidfire-intg-test/src/org/apache/cloudstack/api/solidfire/ApiSolidFireIntegrationTestServiceImpl.java
+++ b/plugins/api/solidfire-intg-test/src/org/apache/cloudstack/api/solidfire/ApiSolidFireIntegrationTestServiceImpl.java
@@ -16,20 +16,18 @@
 // under the License.
 package org.apache.cloudstack.api.solidfire;
 
-import java.util.List;
 import java.util.ArrayList;
+import java.util.List;
 
+import com.cloud.utils.component.AdapterBase;
 import org.apache.cloudstack.api.command.admin.solidfire.GetPathForVolumeCmd;
-// import org.apache.log4j.Logger;
 import org.apache.cloudstack.api.command.admin.solidfire.GetSolidFireAccountIdCmd;
 import org.apache.cloudstack.api.command.admin.solidfire.GetSolidFireVolumeAccessGroupIdCmd;
+import org.apache.cloudstack.api.command.admin.solidfire.GetSolidFireVolumeSizeCmd;
 import org.apache.cloudstack.api.command.admin.solidfire.GetVolumeSnapshotDetailsCmd;
 import org.apache.cloudstack.api.command.admin.solidfire.GetVolumeiScsiNameCmd;
-import org.apache.cloudstack.api.command.admin.solidfire.GetSolidFireVolumeSizeCmd;
 import org.springframework.stereotype.Component;
 
-import com.cloud.utils.component.AdapterBase;
-
 @Component
 public class ApiSolidFireIntegrationTestServiceImpl extends AdapterBase implements ApiSolidFireIntegrationTestService {
     @Override
diff --git a/plugins/ca/root-ca/src/org/apache/cloudstack/ca/provider/RootCACustomTrustManager.java b/plugins/ca/root-ca/src/org/apache/cloudstack/ca/provider/RootCACustomTrustManager.java
index 90f620393ee..acd9843fc2c 100644
--- a/plugins/ca/root-ca/src/org/apache/cloudstack/ca/provider/RootCACustomTrustManager.java
+++ b/plugins/ca/root-ca/src/org/apache/cloudstack/ca/provider/RootCACustomTrustManager.java
@@ -27,13 +27,14 @@
 
 import javax.net.ssl.X509TrustManager;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.certificate.dao.CrlDao;
 import com.google.common.base.Strings;
 
 public final class RootCACustomTrustManager implements X509TrustManager {
-    private static final Logger LOG = Logger.getLogger(RootCACustomTrustManager.class);
+    private static final Logger LOG = LogManager.getLogger(RootCACustomTrustManager.class);
 
     private String clientAddress = "Unknown";
     private boolean authStrictness = true;
diff --git a/plugins/ca/root-ca/src/org/apache/cloudstack/ca/provider/RootCAProvider.java b/plugins/ca/root-ca/src/org/apache/cloudstack/ca/provider/RootCAProvider.java
index 4a3585ac4e2..3679901c616 100644
--- a/plugins/ca/root-ca/src/org/apache/cloudstack/ca/provider/RootCAProvider.java
+++ b/plugins/ca/root-ca/src/org/apache/cloudstack/ca/provider/RootCAProvider.java
@@ -54,7 +54,8 @@
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
 import org.apache.cloudstack.utils.security.CertUtils;
 import org.apache.cloudstack.utils.security.KeyStoreUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.bouncycastle.jce.PKCS10CertificationRequest;
 import org.bouncycastle.jce.provider.BouncyCastleProvider;
 import org.bouncycastle.operator.OperatorCreationException;
@@ -69,7 +70,7 @@
 import com.google.common.base.Strings;
 
 public final class RootCAProvider extends AdapterBase implements CAProvider, Configurable {
-    private static final Logger LOG = Logger.getLogger(RootCAProvider.class);
+    private static final Logger LOG = LogManager.getLogger(RootCAProvider.class);
 
     public static final Integer caValidityYears = 30;
     public static final String caAlias = "root";
diff --git a/plugins/database/mysql-ha/src/com/cloud/utils/db/StaticStrategy.java b/plugins/database/mysql-ha/src/com/cloud/utils/db/StaticStrategy.java
index 6b0cb24878a..164e0755a7b 100644
--- a/plugins/database/mysql-ha/src/com/cloud/utils/db/StaticStrategy.java
+++ b/plugins/database/mysql-ha/src/com/cloud/utils/db/StaticStrategy.java
@@ -23,7 +23,8 @@
 import java.util.Map;
 import java.util.Properties;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.mysql.jdbc.BalanceStrategy;
 import com.mysql.jdbc.Connection;
@@ -32,7 +33,7 @@
 import com.mysql.jdbc.SQLError;
 
 public class StaticStrategy implements BalanceStrategy {
-    private static final Logger s_logger = Logger.getLogger(StaticStrategy.class);
+    private static final Logger s_logger = LogManager.getLogger(StaticStrategy.class);
 
     public StaticStrategy() {
     }
diff --git a/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaBalanceCmd.java b/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaBalanceCmd.java
index 8efa678568e..d58d7ebfd31 100644
--- a/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaBalanceCmd.java
+++ b/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaBalanceCmd.java
@@ -21,7 +21,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.BaseCmd;
@@ -36,7 +37,7 @@
 @APICommand(name = "quotaBalance", responseObject = QuotaStatementItemResponse.class, description = "Create a quota balance statement", since = "4.7.0", requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class QuotaBalanceCmd extends BaseCmd {
 
-    public static final Logger s_logger = Logger.getLogger(QuotaBalanceCmd.class);
+    public static final Logger s_logger = LogManager.getLogger(QuotaBalanceCmd.class);
 
     private static final String s_name = "quotabalanceresponse";
 
diff --git a/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaCreditsCmd.java b/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaCreditsCmd.java
index f12733d2ce3..b1853558c46 100644
--- a/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaCreditsCmd.java
+++ b/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaCreditsCmd.java
@@ -29,7 +29,8 @@
 import org.apache.cloudstack.api.response.QuotaResponseBuilder;
 import org.apache.cloudstack.context.CallContext;
 import org.apache.cloudstack.quota.QuotaService;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import javax.inject.Inject;
 
@@ -42,7 +43,7 @@
     @Inject
     QuotaService _quotaService;
 
-    public static final Logger s_logger = Logger.getLogger(QuotaStatementCmd.class);
+    public static final Logger s_logger = LogManager.getLogger(QuotaStatementCmd.class);
 
     private static final String s_name = "quotacreditsresponse";
 
diff --git a/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaEmailTemplateListCmd.java b/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaEmailTemplateListCmd.java
index 9d013207654..21f01c5456e 100644
--- a/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaEmailTemplateListCmd.java
+++ b/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaEmailTemplateListCmd.java
@@ -22,13 +22,14 @@
 import org.apache.cloudstack.api.response.ListResponse;
 import org.apache.cloudstack.api.response.QuotaEmailTemplateResponse;
 import org.apache.cloudstack.api.response.QuotaResponseBuilder;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import javax.inject.Inject;
 
 @APICommand(name = "quotaEmailTemplateList", responseObject = QuotaEmailTemplateResponse.class, description = "Lists all quota email templates", since = "4.7.0", requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class QuotaEmailTemplateListCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(QuotaEmailTemplateListCmd.class);
+    public static final Logger s_logger = LogManager.getLogger(QuotaEmailTemplateListCmd.class);
     private static final String s_name = "quotaemailtemplatelistresponse";
 
     @Inject
diff --git a/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaEmailTemplateUpdateCmd.java b/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaEmailTemplateUpdateCmd.java
index a47a7832e8c..2261bb33878 100644
--- a/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaEmailTemplateUpdateCmd.java
+++ b/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaEmailTemplateUpdateCmd.java
@@ -25,14 +25,15 @@
 import org.apache.cloudstack.api.response.QuotaResponseBuilder;
 import org.apache.cloudstack.api.response.SuccessResponse;
 import org.apache.cloudstack.quota.constant.QuotaConfig;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import javax.inject.Inject;
 import java.util.Arrays;
 
 @APICommand(name = "quotaEmailTemplateUpdate", responseObject = SuccessResponse.class, description = "Updates existing email templates for quota alerts", since = "4.7.0", requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class QuotaEmailTemplateUpdateCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(QuotaEmailTemplateUpdateCmd.class);
+    public static final Logger s_logger = LogManager.getLogger(QuotaEmailTemplateUpdateCmd.class);
     private static final String s_name = "quotaemailtemplateupdateresponse";
 
     @Inject
diff --git a/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaEnabledCmd.java b/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaEnabledCmd.java
index a10be67599a..a8602f15254 100644
--- a/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaEnabledCmd.java
+++ b/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaEnabledCmd.java
@@ -22,7 +22,8 @@
 import org.apache.cloudstack.api.BaseCmd;
 import org.apache.cloudstack.api.response.QuotaEnabledResponse;
 import org.apache.cloudstack.quota.QuotaService;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 
 import javax.inject.Inject;
@@ -30,7 +31,7 @@
 @APICommand(name = "quotaIsEnabled", responseObject = QuotaEnabledResponse.class, description = "Return true if the plugin is enabled", since = "4.7.0", requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class QuotaEnabledCmd extends BaseCmd {
 
-    public static final Logger s_logger = Logger.getLogger(QuotaEnabledCmd.class);
+    public static final Logger s_logger = LogManager.getLogger(QuotaEnabledCmd.class);
 
     private static final String s_name = "quotaisenabledresponse";
 
diff --git a/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaStatementCmd.java b/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaStatementCmd.java
index 3efdf113da5..93f5ad6947b 100644
--- a/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaStatementCmd.java
+++ b/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaStatementCmd.java
@@ -21,7 +21,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.BaseCmd;
@@ -39,7 +40,7 @@
 @APICommand(name = "quotaStatement", responseObject = QuotaStatementItemResponse.class, description = "Create a quota statement", since = "4.7.0", requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class QuotaStatementCmd extends BaseCmd {
 
-    public static final Logger s_logger = Logger.getLogger(QuotaStatementCmd.class);
+    public static final Logger s_logger = LogManager.getLogger(QuotaStatementCmd.class);
 
     private static final String s_name = "quotastatementresponse";
 
diff --git a/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaSummaryCmd.java b/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaSummaryCmd.java
index 88466e08c6b..05f30047022 100644
--- a/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaSummaryCmd.java
+++ b/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaSummaryCmd.java
@@ -28,7 +28,8 @@
 import org.apache.cloudstack.api.response.QuotaResponseBuilder;
 import org.apache.cloudstack.api.response.QuotaSummaryResponse;
 import org.apache.cloudstack.context.CallContext;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import java.util.List;
 
@@ -36,7 +37,7 @@
 
 @APICommand(name = "quotaSummary", responseObject = QuotaSummaryResponse.class, description = "Lists balance and quota usage for all accounts", since = "4.7.0", requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class QuotaSummaryCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(QuotaSummaryCmd.class);
+    public static final Logger s_logger = LogManager.getLogger(QuotaSummaryCmd.class);
     private static final String s_name = "quotasummaryresponse";
 
     @Parameter(name = ApiConstants.ACCOUNT, type = CommandType.STRING, required = false, description = "Optional, Account Id for which statement needs to be generated")
diff --git a/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaTariffListCmd.java b/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaTariffListCmd.java
index 9e7d1bc0206..b54f4efbbcc 100644
--- a/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaTariffListCmd.java
+++ b/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaTariffListCmd.java
@@ -26,7 +26,8 @@
 import org.apache.cloudstack.api.response.QuotaResponseBuilder;
 import org.apache.cloudstack.api.response.QuotaTariffResponse;
 import org.apache.cloudstack.quota.vo.QuotaTariffVO;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import javax.inject.Inject;
 
@@ -36,7 +37,7 @@
 
 @APICommand(name = "quotaTariffList", responseObject = QuotaTariffResponse.class, description = "Lists all quota tariff plans", since = "4.7.0", requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class QuotaTariffListCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(QuotaTariffListCmd.class);
+    public static final Logger s_logger = LogManager.getLogger(QuotaTariffListCmd.class);
     private static final String s_name = "quotatarifflistresponse";
 
     @Inject
diff --git a/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaTariffUpdateCmd.java b/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaTariffUpdateCmd.java
index 42aa825b094..9c4c695c00f 100644
--- a/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaTariffUpdateCmd.java
+++ b/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaTariffUpdateCmd.java
@@ -27,7 +27,8 @@
 import org.apache.cloudstack.api.response.QuotaResponseBuilder;
 import org.apache.cloudstack.api.response.QuotaTariffResponse;
 import org.apache.cloudstack.quota.vo.QuotaTariffVO;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import javax.inject.Inject;
 
@@ -35,7 +36,7 @@
 
 @APICommand(name = "quotaTariffUpdate", responseObject = QuotaTariffResponse.class, description = "Update the tariff plan for a resource", since = "4.7.0", requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class QuotaTariffUpdateCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(QuotaTariffUpdateCmd.class);
+    public static final Logger s_logger = LogManager.getLogger(QuotaTariffUpdateCmd.class);
     private static final String s_name = "quotatariffupdateresponse";
 
     @Inject
diff --git a/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaUpdateCmd.java b/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaUpdateCmd.java
index 75e2c2c403a..34590c72b42 100644
--- a/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaUpdateCmd.java
+++ b/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaUpdateCmd.java
@@ -24,7 +24,8 @@
 import org.apache.cloudstack.quota.QuotaAlertManager;
 import org.apache.cloudstack.quota.QuotaManager;
 import org.apache.cloudstack.quota.QuotaStatement;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import java.util.Calendar;
 
@@ -33,7 +34,7 @@
 @APICommand(name = "quotaUpdate", responseObject = QuotaUpdateResponse.class, description = "Update quota calculations, alerts and statements", since = "4.7.0", requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class QuotaUpdateCmd extends BaseCmd {
 
-    public static final Logger s_logger = Logger.getLogger(QuotaUpdateCmd.class);
+    public static final Logger s_logger = LogManager.getLogger(QuotaUpdateCmd.class);
 
     private static final String s_name = "quotaupdateresponse";
 
diff --git a/plugins/database/quota/src/org/apache/cloudstack/api/response/QuotaResponseBuilderImpl.java b/plugins/database/quota/src/org/apache/cloudstack/api/response/QuotaResponseBuilderImpl.java
index 5748de58965..ef6900ac7cf 100644
--- a/plugins/database/quota/src/org/apache/cloudstack/api/response/QuotaResponseBuilderImpl.java
+++ b/plugins/database/quota/src/org/apache/cloudstack/api/response/QuotaResponseBuilderImpl.java
@@ -50,7 +50,8 @@
 import org.apache.cloudstack.quota.vo.QuotaTariffVO;
 import org.apache.cloudstack.quota.vo.QuotaUsageVO;
 import org.apache.commons.lang.StringEscapeUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import javax.ejb.Local;
@@ -72,7 +73,7 @@
 @Component
 @Local(value = QuotaResponseBuilderImpl.class)
 public class QuotaResponseBuilderImpl implements QuotaResponseBuilder {
-    private static final Logger s_logger = Logger.getLogger(QuotaResponseBuilderImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(QuotaResponseBuilderImpl.class);
 
     @Inject
     private QuotaTariffDao _quotaTariffDao;
diff --git a/plugins/database/quota/src/org/apache/cloudstack/quota/QuotaServiceImpl.java b/plugins/database/quota/src/org/apache/cloudstack/quota/QuotaServiceImpl.java
index 3efc0959e6f..90bc5442194 100644
--- a/plugins/database/quota/src/org/apache/cloudstack/quota/QuotaServiceImpl.java
+++ b/plugins/database/quota/src/org/apache/cloudstack/quota/QuotaServiceImpl.java
@@ -49,7 +49,8 @@
 import org.apache.cloudstack.quota.vo.QuotaBalanceVO;
 import org.apache.cloudstack.quota.vo.QuotaUsageVO;
 import org.apache.cloudstack.utils.usage.UsageUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import javax.ejb.Local;
@@ -67,7 +68,7 @@
 @Component
 @Local(value = QuotaService.class)
 public class QuotaServiceImpl extends ManagerBase implements QuotaService, Configurable, QuotaConfig {
-    private static final Logger s_logger = Logger.getLogger(QuotaServiceImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(QuotaServiceImpl.class);
 
     @Inject
     private AccountDao _accountDao;
diff --git a/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/DedicateClusterCmd.java b/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/DedicateClusterCmd.java
index edc85610efe..89faefb9ef7 100644
--- a/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/DedicateClusterCmd.java
+++ b/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/DedicateClusterCmd.java
@@ -21,7 +21,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -42,7 +43,7 @@
 @APICommand(name = "dedicateCluster", description = "Dedicate an existing cluster", responseObject = DedicateClusterResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DedicateClusterCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DedicateClusterCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DedicateClusterCmd.class.getName());
 
     private static final String s_name = "dedicateclusterresponse";
     @Inject
diff --git a/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/DedicateHostCmd.java b/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/DedicateHostCmd.java
index 978821a1f0c..243d63e9711 100644
--- a/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/DedicateHostCmd.java
+++ b/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/DedicateHostCmd.java
@@ -21,7 +21,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -42,7 +43,7 @@
 @APICommand(name = "dedicateHost", description = "Dedicates a host.", responseObject = DedicateHostResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DedicateHostCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DedicateHostCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DedicateHostCmd.class.getName());
     private static final String s_name = "dedicatehostresponse";
     @Inject
     DedicatedService dedicatedService;
diff --git a/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/DedicatePodCmd.java b/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/DedicatePodCmd.java
index d18f02d686f..40ac58f226f 100644
--- a/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/DedicatePodCmd.java
+++ b/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/DedicatePodCmd.java
@@ -21,7 +21,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -42,7 +43,7 @@
 @APICommand(name = "dedicatePod", description = "Dedicates a Pod.", responseObject = DedicatePodResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DedicatePodCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DedicatePodCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DedicatePodCmd.class.getName());
 
     private static final String s_name = "dedicatepodresponse";
     @Inject
diff --git a/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/DedicateZoneCmd.java b/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/DedicateZoneCmd.java
index ee71dfecc41..bc084d9a08f 100644
--- a/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/DedicateZoneCmd.java
+++ b/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/DedicateZoneCmd.java
@@ -21,7 +21,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -42,7 +43,7 @@
 @APICommand(name = "dedicateZone", description = "Dedicates a zones.", responseObject = DedicateZoneResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DedicateZoneCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DedicateZoneCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DedicateZoneCmd.class.getName());
 
     private static final String s_name = "dedicatezoneresponse";
     @Inject
diff --git a/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/ListDedicatedClustersCmd.java b/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/ListDedicatedClustersCmd.java
index a8c192dcd8e..4033b5fca38 100644
--- a/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/ListDedicatedClustersCmd.java
+++ b/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/ListDedicatedClustersCmd.java
@@ -21,7 +21,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.affinity.AffinityGroupResponse;
 import org.apache.cloudstack.api.APICommand;
@@ -43,7 +44,7 @@
 @APICommand(name = "listDedicatedClusters", description = "Lists dedicated clusters.", responseObject = DedicateClusterResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListDedicatedClustersCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListDedicatedClustersCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListDedicatedClustersCmd.class.getName());
 
     private static final String s_name = "listdedicatedclustersresponse";
     @Inject
diff --git a/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/ListDedicatedHostsCmd.java b/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/ListDedicatedHostsCmd.java
index 3c167e8966a..ace4b86aa43 100644
--- a/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/ListDedicatedHostsCmd.java
+++ b/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/ListDedicatedHostsCmd.java
@@ -21,7 +21,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.affinity.AffinityGroupResponse;
 import org.apache.cloudstack.api.APICommand;
@@ -43,7 +44,7 @@
 @APICommand(name = "listDedicatedHosts", description = "Lists dedicated hosts.", responseObject = DedicateHostResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListDedicatedHostsCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListDedicatedHostsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListDedicatedHostsCmd.class.getName());
 
     private static final String s_name = "listdedicatedhostsresponse";
     @Inject
diff --git a/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/ListDedicatedPodsCmd.java b/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/ListDedicatedPodsCmd.java
index 5198e49e7a3..a45e4152d71 100644
--- a/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/ListDedicatedPodsCmd.java
+++ b/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/ListDedicatedPodsCmd.java
@@ -21,7 +21,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.affinity.AffinityGroupResponse;
 import org.apache.cloudstack.api.APICommand;
@@ -43,7 +44,7 @@
 @APICommand(name = "listDedicatedPods", description = "Lists dedicated pods.", responseObject = DedicatePodResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListDedicatedPodsCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListDedicatedPodsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListDedicatedPodsCmd.class.getName());
 
     private static final String s_name = "listdedicatedpodsresponse";
     @Inject
diff --git a/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/ListDedicatedZonesCmd.java b/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/ListDedicatedZonesCmd.java
index e75b73b2e4b..e9947f70f74 100644
--- a/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/ListDedicatedZonesCmd.java
+++ b/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/ListDedicatedZonesCmd.java
@@ -21,7 +21,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.affinity.AffinityGroupResponse;
 import org.apache.cloudstack.api.APICommand;
@@ -43,7 +44,7 @@
 @APICommand(name = "listDedicatedZones", description = "List dedicated zones.", responseObject = DedicateZoneResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListDedicatedZonesCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListDedicatedZonesCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListDedicatedZonesCmd.class.getName());
 
     private static final String s_name = "listdedicatedzonesresponse";
     @Inject
diff --git a/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/ReleaseDedicatedClusterCmd.java b/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/ReleaseDedicatedClusterCmd.java
index b1ec3605da5..e599b94d1ae 100644
--- a/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/ReleaseDedicatedClusterCmd.java
+++ b/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/ReleaseDedicatedClusterCmd.java
@@ -18,7 +18,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -36,7 +37,7 @@
 @APICommand(name = "releaseDedicatedCluster", description = "Release the dedication for cluster", responseObject = SuccessResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ReleaseDedicatedClusterCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(ReleaseDedicatedClusterCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ReleaseDedicatedClusterCmd.class.getName());
 
     private static final String s_name = "releasededicatedclusterresponse";
     @Inject
diff --git a/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/ReleaseDedicatedHostCmd.java b/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/ReleaseDedicatedHostCmd.java
index bddef135688..12d74faf4dc 100644
--- a/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/ReleaseDedicatedHostCmd.java
+++ b/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/ReleaseDedicatedHostCmd.java
@@ -18,7 +18,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -36,7 +37,7 @@
 @APICommand(name = "releaseDedicatedHost", description = "Release the dedication for host", responseObject = SuccessResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ReleaseDedicatedHostCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(ReleaseDedicatedHostCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ReleaseDedicatedHostCmd.class.getName());
 
     private static final String s_name = "releasededicatedhostresponse";
     @Inject
diff --git a/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/ReleaseDedicatedPodCmd.java b/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/ReleaseDedicatedPodCmd.java
index f764e8abed1..d9570e2aac1 100644
--- a/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/ReleaseDedicatedPodCmd.java
+++ b/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/ReleaseDedicatedPodCmd.java
@@ -18,7 +18,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -36,7 +37,7 @@
 @APICommand(name = "releaseDedicatedPod", description = "Release the dedication for the pod", responseObject = SuccessResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ReleaseDedicatedPodCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(ReleaseDedicatedPodCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ReleaseDedicatedPodCmd.class.getName());
 
     private static final String s_name = "releasededicatedpodresponse";
     @Inject
diff --git a/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/ReleaseDedicatedZoneCmd.java b/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/ReleaseDedicatedZoneCmd.java
index df04491e2c7..b28dbb6500b 100644
--- a/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/ReleaseDedicatedZoneCmd.java
+++ b/plugins/dedicated-resources/src/org/apache/cloudstack/api/commands/ReleaseDedicatedZoneCmd.java
@@ -18,7 +18,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -36,7 +37,7 @@
 @APICommand(name = "releaseDedicatedZone", description = "Release dedication of zone", responseObject = SuccessResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ReleaseDedicatedZoneCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(ReleaseDedicatedZoneCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ReleaseDedicatedZoneCmd.class.getName());
 
     private static final String s_name = "releasededicatedzoneresponse";
     @Inject
diff --git a/plugins/dedicated-resources/src/org/apache/cloudstack/dedicated/DedicatedResourceManagerImpl.java b/plugins/dedicated-resources/src/org/apache/cloudstack/dedicated/DedicatedResourceManagerImpl.java
index 35bcfc6ae44..f881ea24c11 100644
--- a/plugins/dedicated-resources/src/org/apache/cloudstack/dedicated/DedicatedResourceManagerImpl.java
+++ b/plugins/dedicated-resources/src/org/apache/cloudstack/dedicated/DedicatedResourceManagerImpl.java
@@ -24,7 +24,8 @@
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import org.apache.cloudstack.affinity.AffinityGroup;
@@ -86,7 +87,7 @@
 @Component
 @Local({DedicatedService.class})
 public class DedicatedResourceManagerImpl implements DedicatedService {
-    private static final Logger s_logger = Logger.getLogger(DedicatedResourceManagerImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(DedicatedResourceManagerImpl.class);
 
     @Inject
     AccountDao _accountDao;
diff --git a/plugins/dedicated-resources/test/org/apache/cloudstack/dedicated/manager/DedicatedApiUnitTest.java b/plugins/dedicated-resources/test/org/apache/cloudstack/dedicated/manager/DedicatedApiUnitTest.java
index 12e71bac587..b635a33c18a 100644
--- a/plugins/dedicated-resources/test/org/apache/cloudstack/dedicated/manager/DedicatedApiUnitTest.java
+++ b/plugins/dedicated-resources/test/org/apache/cloudstack/dedicated/manager/DedicatedApiUnitTest.java
@@ -31,7 +31,8 @@
 
 import org.apache.cloudstack.dedicated.DedicatedResourceManagerImpl;
 import org.apache.cloudstack.test.utils.SpringUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -75,7 +76,7 @@
 @RunWith(SpringJUnit4ClassRunner.class)
 @ContextConfiguration(loader = AnnotationConfigContextLoader.class)
 public class DedicatedApiUnitTest {
-    public static final Logger s_logger = Logger.getLogger(DedicatedApiUnitTest.class);
+    public static final Logger s_logger = LogManager.getLogger(DedicatedApiUnitTest.class);
     @Inject
     DedicatedResourceManagerImpl _dedicatedService = new DedicatedResourceManagerImpl();
 
diff --git a/plugins/deployment-planners/implicit-dedication/src/com/cloud/deploy/ImplicitDedicationPlanner.java b/plugins/deployment-planners/implicit-dedication/src/com/cloud/deploy/ImplicitDedicationPlanner.java
index 5bad9226eed..a016c24a8c1 100644
--- a/plugins/deployment-planners/implicit-dedication/src/com/cloud/deploy/ImplicitDedicationPlanner.java
+++ b/plugins/deployment-planners/implicit-dedication/src/com/cloud/deploy/ImplicitDedicationPlanner.java
@@ -25,7 +25,8 @@
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.configuration.Config;
 import com.cloud.exception.InsufficientServerCapacityException;
@@ -42,7 +43,7 @@
 
 public class ImplicitDedicationPlanner extends FirstFitPlanner implements DeploymentClusterPlanner {
 
-    private static final Logger s_logger = Logger.getLogger(ImplicitDedicationPlanner.class);
+    private static final Logger s_logger = LogManager.getLogger(ImplicitDedicationPlanner.class);
 
     @Inject
     private ServiceOfferingDao serviceOfferingDao;
diff --git a/plugins/deployment-planners/user-concentrated-pod/src/com/cloud/deploy/UserConcentratedPodPlanner.java b/plugins/deployment-planners/user-concentrated-pod/src/com/cloud/deploy/UserConcentratedPodPlanner.java
index d39e4db6456..a91536dbc62 100644
--- a/plugins/deployment-planners/user-concentrated-pod/src/com/cloud/deploy/UserConcentratedPodPlanner.java
+++ b/plugins/deployment-planners/user-concentrated-pod/src/com/cloud/deploy/UserConcentratedPodPlanner.java
@@ -21,14 +21,15 @@
 import java.util.Map;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.utils.Pair;
 import com.cloud.vm.VirtualMachineProfile;
 
 public class UserConcentratedPodPlanner extends FirstFitPlanner implements DeploymentClusterPlanner {
 
-    private static final Logger s_logger = Logger.getLogger(UserConcentratedPodPlanner.class);
+    private static final Logger s_logger = LogManager.getLogger(UserConcentratedPodPlanner.class);
 
     /**
      * This method should reorder the given list of Cluster Ids by applying any necessary heuristic
diff --git a/plugins/deployment-planners/user-dispersing/src/com/cloud/deploy/UserDispersingPlanner.java b/plugins/deployment-planners/user-dispersing/src/com/cloud/deploy/UserDispersingPlanner.java
index ce66294ff25..72cf58306e6 100644
--- a/plugins/deployment-planners/user-dispersing/src/com/cloud/deploy/UserDispersingPlanner.java
+++ b/plugins/deployment-planners/user-dispersing/src/com/cloud/deploy/UserDispersingPlanner.java
@@ -25,7 +25,8 @@
 
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.configuration.Config;
 import com.cloud.utils.NumbersUtil;
@@ -34,7 +35,7 @@
 
 public class UserDispersingPlanner extends FirstFitPlanner implements DeploymentClusterPlanner {
 
-    private static final Logger s_logger = Logger.getLogger(UserDispersingPlanner.class);
+    private static final Logger s_logger = LogManager.getLogger(UserDispersingPlanner.class);
 
     /**
      * This method should reorder the given list of Cluster Ids by applying any necessary heuristic
diff --git a/plugins/event-bus/inmemory/src/org/apache/cloudstack/mom/inmemory/InMemoryEventBus.java b/plugins/event-bus/inmemory/src/org/apache/cloudstack/mom/inmemory/InMemoryEventBus.java
index 3e8d0d0ac8a..41d3fceaba0 100644
--- a/plugins/event-bus/inmemory/src/org/apache/cloudstack/mom/inmemory/InMemoryEventBus.java
+++ b/plugins/event-bus/inmemory/src/org/apache/cloudstack/mom/inmemory/InMemoryEventBus.java
@@ -25,7 +25,8 @@
 
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.framework.events.Event;
 import org.apache.cloudstack.framework.events.EventBus;
@@ -38,7 +39,7 @@
 
 public class InMemoryEventBus extends ManagerBase implements EventBus {
 
-    private static final Logger s_logger = Logger.getLogger(InMemoryEventBus.class);
+    private static final Logger s_logger = LogManager.getLogger(InMemoryEventBus.class);
 
     private final static Map<UUID, Pair<EventTopic, EventSubscriber>> subscribers;
 
diff --git a/plugins/event-bus/kafka/src/org/apache/cloudstack/mom/kafka/KafkaEventBus.java b/plugins/event-bus/kafka/src/org/apache/cloudstack/mom/kafka/KafkaEventBus.java
index 17a58a5d232..b698b0eb851 100644
--- a/plugins/event-bus/kafka/src/org/apache/cloudstack/mom/kafka/KafkaEventBus.java
+++ b/plugins/event-bus/kafka/src/org/apache/cloudstack/mom/kafka/KafkaEventBus.java
@@ -27,7 +27,8 @@
 
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.framework.events.Event;
 import org.apache.cloudstack.framework.events.EventBus;
@@ -50,7 +51,7 @@
 
     private String _topic = null;
     private Producer<String,String> _producer;
-    private static final Logger s_logger = Logger.getLogger(KafkaEventBus.class);
+    private static final Logger s_logger = LogManager.getLogger(KafkaEventBus.class);
 
     @Override
     public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
diff --git a/plugins/event-bus/rabbitmq/src/org/apache/cloudstack/mom/rabbitmq/RabbitMQEventBus.java b/plugins/event-bus/rabbitmq/src/org/apache/cloudstack/mom/rabbitmq/RabbitMQEventBus.java
index 5c0d6ce6047..e19ffc6a780 100644
--- a/plugins/event-bus/rabbitmq/src/org/apache/cloudstack/mom/rabbitmq/RabbitMQEventBus.java
+++ b/plugins/event-bus/rabbitmq/src/org/apache/cloudstack/mom/rabbitmq/RabbitMQEventBus.java
@@ -31,7 +31,8 @@
 
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.rabbitmq.client.BlockedListener;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.rabbitmq.client.AMQP;
 import com.rabbitmq.client.AlreadyClosedException;
@@ -94,7 +95,7 @@ public static void setUseSsl(String useSsl) {
     private ExecutorService executorService;
     private static DisconnectHandler disconnectHandler;
     private static BlockedConnectionHandler blockedConnectionHandler;
-    private static final Logger s_logger = Logger.getLogger(RabbitMQEventBus.class);
+    private static final Logger s_logger = LogManager.getLogger(RabbitMQEventBus.class);
 
     @Override
     public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
diff --git a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/AssociateLunCmd.java b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/AssociateLunCmd.java
index dadfe44eb9d..82aec62cb2a 100644
--- a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/AssociateLunCmd.java
+++ b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/AssociateLunCmd.java
@@ -20,7 +20,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -36,7 +37,7 @@
 @APICommand(name = "associateLun", description = "Associate a LUN with a guest IQN", responseObject = AssociateLunCmdResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class AssociateLunCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(AssociateLunCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(AssociateLunCmd.class.getName());
     private static final String s_name = "associatelunresponse";
 
     /////////////////////////////////////////////////////
diff --git a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/CreateLunCmd.java b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/CreateLunCmd.java
index 67004792f63..0f2318c52c7 100644
--- a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/CreateLunCmd.java
+++ b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/CreateLunCmd.java
@@ -20,7 +20,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -40,7 +41,7 @@
 @APICommand(name = "createLunOnFiler", description = "Create a LUN from a pool", responseObject = CreateLunCmdResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreateLunCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateLunCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateLunCmd.class.getName());
     private static final String s_name = "createlunresponse";
 
     /////////////////////////////////////////////////////
diff --git a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/CreateVolumePoolCmd.java b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/CreateVolumePoolCmd.java
index d2eeb875a74..1148cd3705f 100644
--- a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/CreateVolumePoolCmd.java
+++ b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/CreateVolumePoolCmd.java
@@ -18,7 +18,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -38,7 +39,7 @@
 @APICommand(name = "createPool", description = "Create a pool", responseObject = CreateVolumePoolCmdResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class CreateVolumePoolCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateVolumePoolCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(CreateVolumePoolCmd.class.getName());
     private static final String s_name = "createpoolresponse";
 
     @Parameter(name = ApiConstants.NAME, type = CommandType.STRING, required = true, description = "pool name.")
diff --git a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DeleteVolumePoolCmd.java b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DeleteVolumePoolCmd.java
index 6f51cc6e2a7..0e0975e058d 100644
--- a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DeleteVolumePoolCmd.java
+++ b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DeleteVolumePoolCmd.java
@@ -18,7 +18,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -39,7 +40,7 @@
 @APICommand(name = "deletePool", description = "Delete a pool", responseObject = DeleteVolumePoolCmdResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DeleteVolumePoolCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteVolumePoolCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DeleteVolumePoolCmd.class.getName());
     private static final String s_name = "deletepoolresponse";
 
     @Parameter(name = ApiConstants.POOL_NAME, type = CommandType.STRING, required = true, description = "pool name.")
diff --git a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DestroyLunCmd.java b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DestroyLunCmd.java
index cfdc1dacd88..615e65f7395 100644
--- a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DestroyLunCmd.java
+++ b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DestroyLunCmd.java
@@ -20,7 +20,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -41,7 +42,7 @@
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DestroyLunCmd extends BaseCmd {
 
-    public static final Logger s_logger = Logger.getLogger(DestroyLunCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DestroyLunCmd.class.getName());
     private static final String s_name = "destroylunresponse";
 
     @Parameter(name = ApiConstants.PATH, type = CommandType.STRING, required = true, description = "LUN path.")
diff --git a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DestroyVolumeOnFilerCmd.java b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DestroyVolumeOnFilerCmd.java
index 500a84c50db..9a04bb64706 100644
--- a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DestroyVolumeOnFilerCmd.java
+++ b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DestroyVolumeOnFilerCmd.java
@@ -20,7 +20,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -41,7 +42,7 @@
 @APICommand(name = "destroyVolumeOnFiler", description = "Destroy a Volume", responseObject = DeleteVolumeOnFilerCmdResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DestroyVolumeOnFilerCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(DestroyVolumeOnFilerCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DestroyVolumeOnFilerCmd.class.getName());
     private static final String s_name = "destroyvolumeresponse";
 
     @Parameter(name = ApiConstants.AGGREGATE_NAME, type = CommandType.STRING, required = true, description = "aggregate name.")
diff --git a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DissociateLunCmd.java b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DissociateLunCmd.java
index d5c53a18739..a824f2dedeb 100644
--- a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DissociateLunCmd.java
+++ b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DissociateLunCmd.java
@@ -20,7 +20,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -40,7 +41,7 @@
 @APICommand(name = "dissociateLun", description = "Dissociate a LUN", responseObject = DissociateLunCmdResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class DissociateLunCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(DissociateLunCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(DissociateLunCmd.class.getName());
     private static final String s_name = "dissociatelunresponse";
 
     @Parameter(name = ApiConstants.PATH, type = CommandType.STRING, required = true, description = "LUN path.")
diff --git a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ListLunsCmd.java b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ListLunsCmd.java
index c1e1fb87b76..be05b0c10aa 100644
--- a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ListLunsCmd.java
+++ b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ListLunsCmd.java
@@ -21,7 +21,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -43,7 +44,7 @@
 @APICommand(name = "listLunsOnFiler", description = "List LUN", responseObject = ListLunsCmdResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListLunsCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(ListLunsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListLunsCmd.class.getName());
     private static final String s_name = "listlunresponse";
 
     @Parameter(name = ApiConstants.POOL_NAME, type = CommandType.STRING, required = true, description = "pool name.")
diff --git a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ListVolumePoolsCmd.java b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ListVolumePoolsCmd.java
index f6d17c06e60..a69a34ed511 100644
--- a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ListVolumePoolsCmd.java
+++ b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ListVolumePoolsCmd.java
@@ -21,7 +21,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiErrorCode;
@@ -41,7 +42,7 @@
 @APICommand(name = "listPools", description = "List Pool", responseObject = ListVolumePoolsCmdResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListVolumePoolsCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(ListVolumePoolsCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListVolumePoolsCmd.class.getName());
     private static final String s_name = "listpoolresponse";
 
     @Inject
diff --git a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ListVolumesOnFilerCmd.java b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ListVolumesOnFilerCmd.java
index bf72b3afbec..679646618dd 100644
--- a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ListVolumesOnFilerCmd.java
+++ b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ListVolumesOnFilerCmd.java
@@ -21,7 +21,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -43,7 +44,7 @@
 @APICommand(name = "listVolumesOnFiler", description = "List Volumes", responseObject = ListVolumesOnFilerCmdResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ListVolumesOnFilerCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(ListVolumesOnFilerCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ListVolumesOnFilerCmd.class.getName());
     private static final String s_name = "listvolumesresponse";
 
     @Parameter(name = ApiConstants.POOL_NAME, type = CommandType.STRING, required = true, description = "pool name.")
diff --git a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ModifyVolumePoolCmd.java b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ModifyVolumePoolCmd.java
index a5849df3492..9e2a3cbef8b 100644
--- a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ModifyVolumePoolCmd.java
+++ b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ModifyVolumePoolCmd.java
@@ -18,7 +18,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -36,7 +37,7 @@
 @APICommand(name = "modifyPool", description = "Modify pool", responseObject = ModifyVolumePoolCmdResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
 public class ModifyVolumePoolCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(ModifyVolumePoolCmd.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(ModifyVolumePoolCmd.class.getName());
     private static final String s_name = "modifypoolresponse";
 
     @Parameter(name = ApiConstants.POOL_NAME, type = CommandType.STRING, required = true, description = "pool name.")
diff --git a/plugins/file-systems/netapp/src/com/cloud/netapp/NetappDefaultAllocatorImpl.java b/plugins/file-systems/netapp/src/com/cloud/netapp/NetappDefaultAllocatorImpl.java
index 01418252ebf..aa5ba22cbfc 100644
--- a/plugins/file-systems/netapp/src/com/cloud/netapp/NetappDefaultAllocatorImpl.java
+++ b/plugins/file-systems/netapp/src/com/cloud/netapp/NetappDefaultAllocatorImpl.java
@@ -20,12 +20,13 @@
 import java.util.HashMap;
 import java.util.List;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class NetappDefaultAllocatorImpl implements NetappAllocator {
     private static HashMap<String, Integer> s_poolNameToLastVolumeIdAllocated = new HashMap<String, Integer>();
     private final NetappManager _netappMgr;
-    public static final Logger s_logger = Logger.getLogger(NetappDefaultAllocatorImpl.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(NetappDefaultAllocatorImpl.class.getName());
 
     public NetappDefaultAllocatorImpl(NetappManager netappMgr) {
         _netappMgr = netappMgr;
diff --git a/plugins/file-systems/netapp/src/com/cloud/netapp/NetappManagerImpl.java b/plugins/file-systems/netapp/src/com/cloud/netapp/NetappManagerImpl.java
index c226ffeb260..dce4f7981ab 100644
--- a/plugins/file-systems/netapp/src/com/cloud/netapp/NetappManagerImpl.java
+++ b/plugins/file-systems/netapp/src/com/cloud/netapp/NetappManagerImpl.java
@@ -34,7 +34,8 @@
 import netapp.manage.NaException;
 import netapp.manage.NaServer;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.api.commands.netapp.AssociateLunCmd;
@@ -66,7 +67,7 @@
         roundrobin, leastfull
     }
 
-    public static final Logger s_logger = Logger.getLogger(NetappManagerImpl.class.getName());
+    public static final Logger s_logger = LogManager.getLogger(NetappManagerImpl.class.getName());
     @Inject
     public VolumeDao _volumeDao;
     @Inject
diff --git a/plugins/file-systems/netapp/src/com/cloud/netapp/dao/LunDaoImpl.java b/plugins/file-systems/netapp/src/com/cloud/netapp/dao/LunDaoImpl.java
index 58f2ea13edd..55c156d727b 100644
--- a/plugins/file-systems/netapp/src/com/cloud/netapp/dao/LunDaoImpl.java
+++ b/plugins/file-systems/netapp/src/com/cloud/netapp/dao/LunDaoImpl.java
@@ -19,7 +19,8 @@
 import java.util.List;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.netapp.LunVO;
@@ -30,7 +31,7 @@
 
 @Component
 public class LunDaoImpl extends GenericDaoBase<LunVO, Long> implements LunDao {
-    private static final Logger s_logger = Logger.getLogger(PoolDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(PoolDaoImpl.class);
 
     protected final SearchBuilder<LunVO> LunSearch;
     protected final SearchBuilder<LunVO> LunNameSearch;
diff --git a/plugins/file-systems/netapp/src/com/cloud/netapp/dao/PoolDaoImpl.java b/plugins/file-systems/netapp/src/com/cloud/netapp/dao/PoolDaoImpl.java
index 03352d25785..ccc11df5d53 100644
--- a/plugins/file-systems/netapp/src/com/cloud/netapp/dao/PoolDaoImpl.java
+++ b/plugins/file-systems/netapp/src/com/cloud/netapp/dao/PoolDaoImpl.java
@@ -19,7 +19,8 @@
 import java.util.List;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.netapp.PoolVO;
@@ -29,7 +30,7 @@
 
 @Component
 public class PoolDaoImpl extends GenericDaoBase<PoolVO, Long> implements PoolDao {
-    private static final Logger s_logger = Logger.getLogger(PoolDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(PoolDaoImpl.class);
 
     protected final SearchBuilder<PoolVO> PoolSearch;
 
diff --git a/plugins/file-systems/netapp/src/com/cloud/netapp/dao/VolumeDaoImpl.java b/plugins/file-systems/netapp/src/com/cloud/netapp/dao/VolumeDaoImpl.java
index 70db5bc66a9..f73621cc17c 100644
--- a/plugins/file-systems/netapp/src/com/cloud/netapp/dao/VolumeDaoImpl.java
+++ b/plugins/file-systems/netapp/src/com/cloud/netapp/dao/VolumeDaoImpl.java
@@ -19,7 +19,8 @@
 import java.util.List;
 
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.netapp.NetappVolumeVO;
@@ -30,7 +31,7 @@
 
 @Component(value = "netappVolumeDaoImpl")
 public class VolumeDaoImpl extends GenericDaoBase<NetappVolumeVO, Long> implements VolumeDao {
-    private static final Logger s_logger = Logger.getLogger(VolumeDaoImpl.class);
+    private static final Logger s_logger = LogManager.getLogger(VolumeDaoImpl.class);
 
     protected final SearchBuilder<NetappVolumeVO> NetappVolumeSearch;
     protected final SearchBuilder<NetappVolumeVO> NetappListVolumeSearch;
diff --git a/plugins/ha-planners/skip-heurestics/src/com/cloud/deploy/SkipHeuresticsPlanner.java b/plugins/ha-planners/skip-heurestics/src/com/cloud/deploy/SkipHeuresticsPlanner.java
index 598cea674c8..813b6bf1dad 100644
--- a/plugins/ha-planners/skip-heurestics/src/com/cloud/deploy/SkipHeuresticsPlanner.java
+++ b/plugins/ha-planners/skip-heurestics/src/com/cloud/deploy/SkipHeuresticsPlanner.java
@@ -17,7 +17,8 @@
 package com.cloud.deploy;
 
 import com.cloud.vm.VirtualMachineProfile;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 
 import javax.naming.ConfigurationException;
@@ -25,7 +26,7 @@
 import java.util.Map;
 
 public class SkipHeuresticsPlanner extends FirstFitPlanner implements HAPlanner {
-    private static final Logger s_logger = Logger.getLogger(SkipHeuresticsPlanner.class);
+    private static final Logger s_logger = LogManager.getLogger(SkipHeuresticsPlanner.class);
 
 
     /**
diff --git a/plugins/host-allocators/random/src/com/cloud/agent/manager/allocator/impl/RandomAllocator.java b/plugins/host-allocators/random/src/com/cloud/agent/manager/allocator/impl/RandomAllocator.java
index 1b373f7e73d..e60c046e345 100644
--- a/plugins/host-allocators/random/src/com/cloud/agent/manager/allocator/impl/RandomAllocator.java
+++ b/plugins/host-allocators/random/src/com/cloud/agent/manager/allocator/impl/RandomAllocator.java
@@ -22,7 +22,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.agent.manager.allocator.HostAllocator;
@@ -40,7 +41,7 @@
 
 @Component
 public class RandomAllocator extends AdapterBase implements HostAllocator {
-    private static final Logger s_logger = Logger.getLogger(RandomAllocator.class);
+    private static final Logger s_logger = LogManager.getLogger(RandomAllocator.class);
     @Inject
     private HostDao _hostDao;
     @Inject
diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalDiscoverer.java b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalDiscoverer.java
index 98ab514e4e7..d674a503a2f 100644
--- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalDiscoverer.java
+++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalDiscoverer.java
@@ -33,7 +33,8 @@
 import javax.naming.ConfigurationException;
 
 import org.apache.cloudstack.api.ApiConstants;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.agent.api.StartupCommand;
 import com.cloud.agent.api.StartupRoutingCommand;
@@ -61,7 +62,7 @@
 import com.cloud.vm.dao.VMInstanceDao;
 
 public class BareMetalDiscoverer extends DiscovererBase implements Discoverer, ResourceStateAdapter {
-    protected static final Logger s_logger = Logger.getLogger(BareMetalDiscoverer.class);
+    protected static final Logger s_logger = LogManager.getLogger(BareMetalDiscoverer.class);
     @Inject
     protected VMInstanceDao _vmDao = null;
 
diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalGuru.java b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalGuru.java
index 3213198e3f1..f60a9e0037f 100644
--- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalGuru.java
+++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalGuru.java
@@ -27,7 +27,8 @@
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.cloud.agent.api.to.VirtualMachineTO;
 import com.cloud.host.dao.HostDao;
@@ -41,7 +42,7 @@
 import com.cloud.vm.dao.VMInstanceDao;
 
 public class BareMetalGuru extends HypervisorGuruBase implements HypervisorGuru {
-    private static final Logger s_logger = Logger.getLogger(BareMetalGuru.class);
+    private static final Logger s_logger = LogManager.getLogger(BareMetalGuru.class);
     @Inject
     GuestOSDao _guestOsDao;
     @Inject
diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalPlanner.java b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalPlanner.java
index 5d6472bfcbe..65c16f8453d 100644
--- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalPlanner.java
+++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalPlanner.java
@@ -23,7 +23,8 @@
 import javax.naming.C