<artifactId>httpcore</artifactId>\r
<version>4.3</version>\r
</dependency>\r
- <!--dependency>\r
+ <dependency>\r
<groupId>org.codehaus.jackson</groupId>\r
<artifactId>jackson-jaxrs</artifactId>\r
- <version>1.9.12</version>\r
- </dependency-->\r
- <dependency>\r
- <groupId>com.google.code.gson</groupId>\r
- <artifactId>gson</artifactId>\r
- <version>2.8.2</version>\r
+ <version>1.9.13</version>\r
+ <!--<exclusions>\r
+ <exclusion>\r
+ <groupId>org.codehaus.jackson</groupId>\r
+ <artifactId>jackson-mapper-asl</artifactId>\r
+ </exclusion>\r
+ </exclusions>-->\r
+ </dependency>\r
+\r
+ <!--dependency>\r
+ <groupId>com.fasterxml.jackson.core</groupId>\r
+ <artifactId>jackson-databind</artifactId>\r
+ <version>2.10.0</version>\r
</dependency>\r
+ <dependency>\r
+ <groupId>com.fasterxml.jackson.core</groupId>\r
+ <artifactId>jackson-core</artifactId>\r
+ <version>2.10.0</version>\r
+ </dependency-->\r
+\r
<dependency>\r
<groupId>commons-io</groupId>\r
<artifactId>commons-io</artifactId>\r
<artifactId>jetty-all</artifactId>\r
<version>8.1.16.v20140903</version>\r
</dependency>\r
-\r
<!--\r
<dependency>\r
<groupId>mysql</groupId>\r
<artifactId>snakeyaml</artifactId>\r
<version>1.15</version>\r
</dependency>\r
- <!--dependency>\r
- <groupId>org.slf4j</groupId>\r
- <artifactId>slf4j-log4j12</artifactId>\r
- <version>1.6.1</version>\r
- </dependency-->\r
<dependency>\r
<groupId>org.apache.logging.log4j</groupId>\r
- <artifactId>log4j-core</artifactId>\r
+ <artifactId>log4j-slf4j-impl</artifactId>\r
<version>2.13.0</version>\r
</dependency>\r
-\r
<!--dependency>\r
<groupId>org.apache.log4j</groupId>\r
<artifactId>com.springsource.org.apache.log4j</artifactId>\r
<version>1.19</version>\r
<scope>test</scope>\r
</dependency>\r
- <dependency>\r
- <groupId>log4j</groupId>\r
- <artifactId>log4j</artifactId>\r
- <version>1.2.17</version>\r
- <scope>test</scope>\r
- </dependency>\r
\r
<!-- UT coverage dependency end -->\r
\r
package org.onap.vfc.nfvo.multivimproxy.common.util;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
import org.onap.vfc.nfvo.multivimproxy.common.constant.ParamConstant;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import net.sf.json.JSONArray;
import net.sf.json.JSONException;
import net.sf.json.JSONObject;
+
/**
*
* Json Utility Class.<br/>
*/
public final class JsonUtil {
- private static final Logger LOG = LogManager.getLogger(StringUtil.class);
+ private static final Logger LOG = LoggerFactory.getLogger(StringUtil.class);
private static final int TYPE_STRING = 0;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang.StringUtils;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
+import org.onap.vfc.nfvo.multivimproxy.common.util.ResourceUtil;
import org.onap.vfc.nfvo.multivimproxy.common.constant.Constant;
import org.onap.vfc.nfvo.multivimproxy.common.constant.ParamConstant;
import org.onap.vfc.nfvo.multivimproxy.common.util.restclient.Restful;
import org.onap.vfc.nfvo.multivimproxy.common.util.restclient.RestfulParametes;
import org.onap.vfc.nfvo.multivimproxy.common.util.restclient.RestfulResponse;
import org.onap.vfc.nfvo.multivimproxy.common.util.restclient.ServiceException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import net.sf.json.JSONArray;
import net.sf.json.JSONException;
public static final String NO_RESULT_EXCEPTION =
"org.openo.nfvo.resmanage.service.group.resoperate.add.res.no.result";
- private static final Logger LOGGER = LogManager.getLogger(RestfulUtil.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(RestfulUtil.class);
private static final Restful REST_CLIENT_HTTP = RestfulFactory.getRestInstance(RestfulFactory.PROTO_HTTP);
import java.text.DecimalFormat;
import org.apache.commons.lang.StringUtils;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
*
*/
public final class StringUtil {
- private static final Logger LOGGER = LogManager.getLogger(StringUtil.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(StringUtil.class);
private StringUtil() {
}
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.io.IOUtils;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
import org.onap.vfc.nfvo.multivimproxy.common.util.restclient.RestfulClientConst;
import org.onap.vfc.nfvo.multivimproxy.common.util.restclient.RestfulParametes;
import org.onap.vfc.nfvo.multivimproxy.common.util.restclient.ServiceException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import net.sf.json.JSONException;
import net.sf.json.JSONObject;
*/
public final class RequestUtil {
- private static final Logger LOGGER = LogManager.getLogger(RequestUtil.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(RequestUtil.class);
/**
* Constructor<br/>
import java.util.List;
import java.util.Map;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
import org.onap.vfc.nfvo.multivimproxy.common.constant.HttpConstant;
import org.onap.vfc.nfvo.multivimproxy.common.constant.ParamConstant;
import org.onap.vfc.nfvo.multivimproxy.common.constant.ResponseConstant;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import net.sf.json.JSONObject;
*/
public final class RoaResponseUtil {
- private static final Logger LOGGER = LogManager.getLogger(RoaResponseUtil.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(RoaResponseUtil.class);
private RoaResponseUtil() {
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
import org.eclipse.jetty.client.Address;
import org.eclipse.jetty.client.HttpClient;
import org.eclipse.jetty.client.HttpExchange;
import org.eclipse.jetty.http.HttpMethods;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* <br/>
*/
public abstract class HttpBaseRest implements Restful {
- private static final Logger LOG = LogManager.getLogger(HttpRest.class);
+ private static final Logger LOG = LoggerFactory.getLogger(HttpRest.class);
final AtomicInteger requestId = new AtomicInteger(0);
package org.onap.vfc.nfvo.multivimproxy.common.util.restclient;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
import org.eclipse.jetty.client.HttpClient;
import org.eclipse.jetty.http.HttpMethods;
import org.eclipse.jetty.util.thread.QueuedThreadPool;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* <br/>
*/
public class HttpRest extends HttpBaseRest {
- private static final Logger LOG = LogManager.getLogger(HttpRest.class);
+ private static final Logger LOG = LoggerFactory.getLogger(HttpRest.class);
/**
* Initializing Rest options.<br/>
import java.io.IOException;
import java.io.UnsupportedEncodingException;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
import org.eclipse.jetty.client.ContentExchange;
import org.eclipse.jetty.client.HttpClient;
import org.eclipse.jetty.client.HttpExchange;
import org.eclipse.jetty.util.ssl.SslContextFactory;
import org.eclipse.jetty.util.thread.QueuedThreadPool;
import org.onap.vfc.nfvo.multivimproxy.common.util.request.RequestUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class HttpsRest extends HttpBaseRest {
- private static final Logger LOG = LogManager.getLogger(HttpsRest.class);
+ private static final Logger LOG = LoggerFactory.getLogger(HttpsRest.class);
private static final String UNSUPPORTED_EXCEPTION = "UnsupportedEncodingException: ";
public void initHttpsRest() {
import java.util.zip.GZIPInputStream;
import org.apache.commons.lang.StringUtils;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
import org.eclipse.jetty.client.ContentExchange;
import org.eclipse.jetty.client.HttpDestination;
import org.eclipse.jetty.http.HttpFields;
import org.eclipse.jetty.http.HttpHeaders;
import org.eclipse.jetty.io.Buffer;
import org.eclipse.jetty.util.StringUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* ContentExchange implementation classe to provide access to response.
*/
public class RestHttpContentExchange extends ContentExchange {
- private static final Logger LOGGER = LogManager.getLogger(RestHttpContentExchange.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(RestHttpContentExchange.class);
private boolean gzip = false;
import java.io.FileReader;
import java.io.IOException;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import net.sf.json.JSONObject;
*/
public class RestfulConfigure {
- private static final Logger LOG = LogManager.getLogger(RestfulConfigure.class);
+ private static final Logger LOG = LoggerFactory.getLogger(RestfulConfigure.class);
private RestfulOptions options = null;
package org.onap.vfc.nfvo.multivimproxy.common.util.restclient;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-
import java.util.HashMap;
import java.util.Map;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* RestFul instance factory. <br/>
*/
public static final String PROTO_HTTP = "http";
- private static final Logger LOG = LogManager.getLogger(RestfulFactory.class);
+ private static final Logger LOG = LoggerFactory.getLogger(RestfulFactory.class);
private static final Map<String, Restful> INSTANCES = new HashMap<>(2);
import java.io.File;
import java.io.IOException;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* System environment variable helper implementation.<br/>
*/
public class SystemEnvVariablesDefImpl implements SystemEnvVariables {
- private static final Logger LOG = LogManager.getLogger(SystemEnvVariablesDefImpl.class);
+ private static final Logger LOG = LoggerFactory.getLogger(SystemEnvVariablesDefImpl.class);
@Override
public String getAppRoot() {
import java.util.Map;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
import org.onap.vfc.nfvo.multivimproxy.common.constant.Constant;
import org.onap.vfc.nfvo.multivimproxy.common.constant.HttpConstant;
import org.onap.vfc.nfvo.multivimproxy.common.util.RestfulUtil;
import org.onap.vfc.nfvo.multivimproxy.service.adapter.inf.IMultivimProxyAdapter2MSBManager;
import org.onap.vfc.nfvo.multivimproxy.common.util.restclient.RestfulResponse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import net.sf.json.JSONObject;
*/
public class MultivimProxyAdapter2MSBManager implements IMultivimProxyAdapter2MSBManager {
- private static final Logger LOG = LogManager.getLogger(MultivimProxyAdapter2MSBManager.class);
+ private static final Logger LOG = LoggerFactory.getLogger(MultivimProxyAdapter2MSBManager.class);
@Override
public JSONObject registerProxy(Map<String, String> paramsMap, JSONObject driverInfo) {
import java.util.Map;
import java.util.concurrent.Executors;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
import org.onap.vfc.nfvo.multivimproxy.common.constant.Constant;
import org.onap.vfc.nfvo.multivimproxy.common.constant.HttpConstant;
import org.onap.vfc.nfvo.multivimproxy.common.constant.ParamConstant;
import org.onap.vfc.nfvo.multivimproxy.common.util.restclient.SystemEnvVariablesFactory;
import org.onap.vfc.nfvo.multivimproxy.service.adapter.inf.IMultivimProxyAdapter2MSBManager;
import org.onap.vfc.nfvo.multivimproxy.service.adapter.inf.IMultivimProxyAdapterMgrService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import net.sf.json.JSONObject;
*/
public class MultivimProxyAdapterMgrService implements IMultivimProxyAdapterMgrService {
- private static final Logger LOG = LogManager.getLogger(MultivimProxyAdapterMgrService.class);
+ private static final Logger LOG = LoggerFactory.getLogger(MultivimProxyAdapterMgrService.class);
public static final String RESMGRADAPTERINFO = "resmgradapterinfo.json";
import javax.ws.rs.core.MediaType;
import org.apache.commons.io.IOUtils;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
import org.onap.vfc.nfvo.multivimproxy.common.conf.Config;
import org.onap.vfc.nfvo.multivimproxy.common.constant.Constant;
import org.onap.vfc.nfvo.multivimproxy.common.constant.ParamConstant;
import org.onap.vfc.nfvo.multivimproxy.common.util.request.RequestUtil;
import org.onap.vfc.nfvo.multivimproxy.common.util.restclient.RestfulParametes;
import org.onap.vfc.nfvo.multivimproxy.common.util.restclient.RestfulResponse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
@Consumes(MediaType.APPLICATION_JSON)
public class ProxyRoa {
- private static final Logger LOGGER = LogManager.getLogger(ProxyRoa.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(ProxyRoa.class);
private static final String vimId = Config.getCloudRegionId() + "_" + Config.getCloudRegionId();
+++ /dev/null
-###############################################################################
-# Copyright 2016, Huawei Technologies Co., Ltd.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-###############################################################################
-log4j.rootLogger=INFO,root
-log4j.appender.root.Append=true
-log4j.appender.root.File=${catalina.base}/logs/multivimproxy.log
-log4j.appender.root.layout.ConversionPattern=%d %-5p [%t][%X{moduleID}][%C %L] %m%n
-log4j.appender.root.layout=org.apache.log4j.PatternLayout
-log4j.appender.root.MaxBackupIndex=50
-log4j.appender.root.MaxFileSize=20MB
-log4j.appender.root=org.apache.log4j.RollingFileAppender
\ No newline at end of file
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################
-appenders = root
+#log4j.rootLogger=INFO,root
+rootLogger.level=INFO
+rootLogger.appenderRefs=file
+rootLogger.appenderRef.root.ref=RollingFile
+
+#Log Directory
+property.logDir=/var/log/onap
+property.componentName=vfc
+property.subComponentName=huaweivnfmdriver
-# Redirect log messages to a log file, support file rolling.
appender.root.type = RollingFile
-appender.root.name = root
-appender.root.Append=true
-appender.root.fileName=${catalina.base}/logs/multivimproxy.log
-appender.root.filePattern=${catalina.base}/logs/multivimproxy.log
+appender.root.name = RollingFile
+appender.root.append=true
+appender.root.fileName=${logDir}/${componentName}/${subComponentName}/vnfmadapterservice.log
+appender.root.filePattern=${logDir}/${componentName}/${subComponentName}/vnfmadapterservice.%d{dd-MMM}.log
appender.root.policies.type=Policies
appender.root.policies.size.type=SizeBasedTriggeringPolicy
appender.root.policies.size.size=20MB
appender.root.layout.type=PatternLayout
appender.root.layout.pattern=%d %-5p [%t][%X{moduleID}][%C %L] %m%n
-#log4j.rootLogger=INFO, root
-rootLogger.level=INFO
-rootLogger.appenderRefs=file
-rootLogger.appenderRef.file.ref=root
\ No newline at end of file
import java.util.concurrent.atomic.AtomicInteger;
import java.util.zip.GZIPInputStream;
-import org.apache.log4j.Level;
-import org.apache.log4j.LogManager;
+/*import org.apache.log4j.Level;
+import org.apache.log4j.LogManager;*/
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.LogManager;
import org.eclipse.jetty.client.Address;
import org.eclipse.jetty.client.CachedExchange;
import org.eclipse.jetty.client.HttpDestination;
*/
@After
public void tearDown() throws Exception {
- LogManager.getLogger(RestHttpContentExchange.class).setLevel(Level.ERROR);
+ LogManager.getLogger(RestHttpContentExchange.class).atLevel(Level.ERROR);
}
/**
exchange.setRequestURI("/the/request/uri");
exchange.onRequestCommitted();
- LogManager.getLogger(RestHttpContentExchange.class).setLevel(Level.DEBUG);
+ LogManager.getLogger(RestHttpContentExchange.class).atLevel(Level.DEBUG);
exchange.onRequestCommitted();
}
exchange.setRequestURI("/the/request/uri");
exchange.onRequestComplete();
- LogManager.getLogger(RestHttpContentExchange.class).setLevel(Level.DEBUG);
+ LogManager.getLogger(RestHttpContentExchange.class).atLevel(Level.DEBUG);
exchange.onRequestComplete();
}
exchange.setRequestURI("/the/request/uri");
exchange.onResponseComplete();
- LogManager.getLogger(RestHttpContentExchange.class).setLevel(Level.DEBUG);
+ LogManager.getLogger(RestHttpContentExchange.class).atLevel(Level.DEBUG);
exchange.onResponseComplete();
final AtomicInteger isCallback = new AtomicInteger(0);