mirror of https://github.com/apache/cloudstack.git
Fix build errors due to log4j 2.x changes
This commit is contained in:
parent
7b57480d60
commit
bf9fdaddbd
|
|
@ -16,8 +16,6 @@
|
|||
// under the License.
|
||||
package com.cloud.upgrade.dao;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.upgrade.SystemVmTemplateRegistration;
|
||||
import com.cloud.utils.exception.CloudRuntimeException;
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ import com.cloud.utils.DateUtil;
|
|||
import com.cloud.utils.db.GenericDaoBase;
|
||||
import com.cloud.utils.db.SearchCriteria;
|
||||
import com.cloud.utils.db.TransactionLegacy;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.sql.PreparedStatement;
|
||||
|
|
@ -34,7 +33,6 @@ import java.util.TimeZone;
|
|||
|
||||
@Component
|
||||
public class UsageVpcDaoImpl extends GenericDaoBase<UsageVpcVO, Long> implements UsageVpcDao {
|
||||
private static final Logger LOGGER = Logger.getLogger(UsageVpcDaoImpl.class);
|
||||
protected static final String GET_USAGE_RECORDS_BY_ACCOUNT = "SELECT id, vpc_id, zone_id, account_id, domain_id, state, created, removed FROM usage_vpc WHERE " +
|
||||
" account_id = ? AND ((removed IS NULL AND created <= ?) OR (created BETWEEN ? AND ?) OR (removed BETWEEN ? AND ?) " +
|
||||
" OR ((created <= ?) AND (removed >= ?)))";
|
||||
|
|
@ -52,7 +50,7 @@ public class UsageVpcDaoImpl extends GenericDaoBase<UsageVpcVO, Long> implements
|
|||
update(vo.getId(), vo);
|
||||
}
|
||||
} catch (final Exception e) {
|
||||
LOGGER.error(String.format("Error updating usage of VPC due to [%s].", e.getMessage()), e);
|
||||
logger.error(String.format("Error updating usage of VPC due to [%s].", e.getMessage()), e);
|
||||
txn.rollback();
|
||||
} finally {
|
||||
txn.close();
|
||||
|
|
@ -74,7 +72,7 @@ public class UsageVpcDaoImpl extends GenericDaoBase<UsageVpcVO, Long> implements
|
|||
}
|
||||
} catch (final Exception e) {
|
||||
txn.rollback();
|
||||
LOGGER.error(String.format("Error updating usage of VPC due to [%s].", e.getMessage()), e);
|
||||
logger.error(String.format("Error updating usage of VPC due to [%s].", e.getMessage()), e);
|
||||
} finally {
|
||||
txn.close();
|
||||
}
|
||||
|
|
@ -121,7 +119,7 @@ public class UsageVpcDaoImpl extends GenericDaoBase<UsageVpcVO, Long> implements
|
|||
}
|
||||
} catch (Exception e) {
|
||||
txn.rollback();
|
||||
LOGGER.warn("Error getting VPC usage records", e);
|
||||
logger.warn("Error getting VPC usage records", e);
|
||||
} finally {
|
||||
txn.close();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1045,7 +1045,7 @@ public class UsageManagerImpl extends ManagerBase implements UsageManager, Runna
|
|||
}
|
||||
parsed = VpcUsageParser.parse(account, currentStartDate, currentEndDate);
|
||||
if (!parsed) {
|
||||
s_logger.debug(String.format("VPC usage failed to parse for account [%s].", account));
|
||||
logger.debug(String.format("VPC usage failed to parse for account [%s].", account));
|
||||
}
|
||||
return parsed;
|
||||
}
|
||||
|
|
@ -2140,7 +2140,7 @@ public class UsageManagerImpl extends ManagerBase implements UsageManager, Runna
|
|||
UsageVpcVO usageVPCVO = new UsageVpcVO(event.getResourceId(), event.getZoneId(), event.getAccountId(), domainId, Vpc.State.Enabled.name(), event.getCreateDate(), null);
|
||||
usageVpcDao.persist(usageVPCVO);
|
||||
} else {
|
||||
s_logger.error(String.format("Unknown event type [%s] in VPC event parser. Skipping it.", event.getType()));
|
||||
logger.error(String.format("Unknown event type [%s] in VPC event parser. Skipping it.", event.getType()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,16 +24,17 @@ import com.cloud.user.AccountVO;
|
|||
import javax.annotation.PostConstruct;
|
||||
import javax.inject.Inject;
|
||||
import org.apache.cloudstack.usage.UsageTypes;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
@Component
|
||||
public class VpcUsageParser {
|
||||
private static final Logger LOGGER = Logger.getLogger(VpcUsageParser.class.getName());
|
||||
private static final Logger LOGGER = LogManager.getLogger(VpcUsageParser.class.getName());
|
||||
|
||||
@Inject
|
||||
private UsageVpcDao vpcDao;
|
||||
|
|
|
|||
Loading…
Reference in New Issue