diff --git a/yxt-common/yxt-common-base/pom.xml b/yxt-common/yxt-common-base/pom.xml index 35c4cf0..a7cc522 100644 --- a/yxt-common/yxt-common-base/pom.xml +++ b/yxt-common/yxt-common-base/pom.xml @@ -176,11 +176,6 @@ 1.18 - - org.minbox.framework - api-boot-starter-logging - - diff --git a/yxt-common/yxt-common-base/src/main/java/com/yxt/common/base/config/logging/Log.java b/yxt-common/yxt-common-base/src/main/java/com/yxt/common/base/config/logging/Log.java deleted file mode 100644 index 97e8efb..0000000 --- a/yxt-common/yxt-common-base/src/main/java/com/yxt/common/base/config/logging/Log.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.yxt.common.base.config.logging; - -import java.io.Serializable; -import java.util.Map; - -/** - * @Author dimengzhe - * @Date 2022/6/21 15:48 - * @Description - */ -public class Log implements Serializable { - - private static final long serialVersionUID = 3958980733637576088L; - private String serviceId; - private String requestIp; - private String serviceIp; - private String servicePort; - private Integer httpStatus; - private String requestMethod; - private String requestUri; - - private Map requestBodyN; - private Map responseBodyN; - - public String getRequestMethod() { - return requestMethod; - } - - public void setRequestMethod(String requestMethod) { - this.requestMethod = requestMethod; - } - - public String getRequestUri() { - return requestUri; - } - - public void setRequestUri(String requestUri) { - this.requestUri = requestUri; - } - - public Integer getHttpStatus() { - return httpStatus; - } - - public void setHttpStatus(Integer httpStatus) { - this.httpStatus = httpStatus; - } - - public String getRequestIp() { - return requestIp; - } - - public void setRequestIp(String requestIp) { - this.requestIp = requestIp; - } - - public String getServiceIp() { - return serviceIp; - } - - public void setServiceIp(String serviceIp) { - this.serviceIp = serviceIp; - } - - public String getServicePort() { - return servicePort; - } - - public void setServicePort(String servicePort) { - this.servicePort = servicePort; - } - - public String getServiceId() { - return serviceId; - } - - public void setServiceId(String serviceId) { - this.serviceId = serviceId; - } - - public Map getRequestBodyN() { - return requestBodyN; - } - - public void setRequestBodyN(Map requestBodyN) { - this.requestBodyN = requestBodyN; - } - - public Map getResponseBodyN() { - return responseBodyN; - } - - public void setResponseBodyN(Map responseBodyN) { - this.responseBodyN = responseBodyN; - } -} diff --git a/yxt-common/yxt-common-base/src/main/java/com/yxt/common/base/config/logging/LoggingLocalNotice.java b/yxt-common/yxt-common-base/src/main/java/com/yxt/common/base/config/logging/LoggingLocalNotice.java deleted file mode 100644 index 77bdb08..0000000 --- a/yxt-common/yxt-common-base/src/main/java/com/yxt/common/base/config/logging/LoggingLocalNotice.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.yxt.common.base.config.logging; - -import cn.hutool.core.bean.BeanUtil; -import com.alibaba.fastjson.JSONObject; -import com.alibaba.fastjson.TypeReference; -import org.apache.commons.lang3.StringUtils; -import org.minbox.framework.logging.client.LoggingFactoryBean; -import org.minbox.framework.logging.client.notice.LoggingNotice; -import org.minbox.framework.logging.core.MinBoxLog; -import org.minbox.framework.util.JsonUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; - -import java.util.Map; - -/** - * @Author dimengzhe - * @Date 2022/6/21 11:27 - * @Description 日志模板 - */ -@Component -public class LoggingLocalNotice implements LoggingNotice { - - public static final String BEAN_NAME = "loggingLocalNotice"; - static Logger logger = LoggerFactory.getLogger(LoggingLocalNotice.class); - private final LoggingFactoryBean loggingFactoryBean; - - public LoggingLocalNotice(LoggingFactoryBean loggingFactoryBean) { - this.loggingFactoryBean = loggingFactoryBean; - } - - @Override - public void notice(MinBoxLog minBoxLog) { - if (this.loggingFactoryBean.isShowConsoleLog()) { - logger.info("=====接口开始:" + minBoxLog.getRequestUri()); - Log log = new Log(); - if (StringUtils.isNotBlank(minBoxLog.getRequestBody())) { - JSONObject jsonObject = JSONObject.parseObject(minBoxLog.getRequestBody()); - Map map = JSONObject.parseObject(jsonObject.toJSONString(), new TypeReference>() { - }); - log.setRequestBodyN(map); - - } - if (StringUtils.isNotBlank(minBoxLog.getResponseBody())) { - JSONObject jsonObject = JSONObject.parseObject(minBoxLog.getResponseBody()); - Map map = JSONObject.parseObject(jsonObject.toJSONString(), new TypeReference>() { - }); - log.setResponseBodyN(map); - } - log.setHttpStatus(minBoxLog.getHttpStatus()); - BeanUtil.copyProperties(minBoxLog, log); -// logger.info("Request Uri:{}, Logging:\n{}", minBoxLog.getRequestUri(), this.loggingFactoryBean.isFormatConsoleLog() ? JsonUtils.beautifyJson(minBoxLog) : JsonUtils.toJsonString(minBoxLog)); - logger.info("Logging:\n{}", this.loggingFactoryBean.isFormatConsoleLog() ? JsonUtils.beautifyJson(log) : JsonUtils.toJsonString(log)); - logger.info("====接口结束"); - } - - } - - @Override - public int getOrder() { - return -2147483648; - } -} diff --git a/yxt-parent/pom.xml b/yxt-parent/pom.xml index 49da0ff..5bef1c7 100644 --- a/yxt-parent/pom.xml +++ b/yxt-parent/pom.xml @@ -400,15 +400,6 @@ - - - org.minbox.framework - api-boot-dependencies - 2.3.3.RELEASE - pom - import - -