| | |
| | | package com.zy.ai.log; |
| | | |
| | | import ch.qos.logback.classic.spi.ILoggingEvent; |
| | | import ch.qos.logback.classic.spi.ThrowableProxyUtil; |
| | | import ch.qos.logback.core.AppenderBase; |
| | | |
| | | import java.time.Instant; |
| | |
| | | message |
| | | ); |
| | | |
| | | String throwable = event.getThrowableProxy() != null ? ThrowableProxyUtil.asString(event.getThrowableProxy()) : null; |
| | | if (throwable != null && !throwable.isEmpty()) { |
| | | logLine = logLine + System.lineSeparator() + throwable; |
| | | } |
| | | |
| | | // 放进环形缓冲区 |
| | | if (LOG_BUFFER.remainingCapacity() == 0) { |
| | | LOG_BUFFER.pollFirst(); // 移除最旧的 |
| | |
| | | News.error("请求WMS接口失败!!!url:{};request:{};response:{}", wmsUrl + wmsSystemInUrl, JSON.toJSONString(requestParam), response); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | News.error("请求WMS接口异常!!!url:{};request:{};response:{}", wmsUrl + wmsSystemInUrl, JSON.toJSONString(requestParam), response, e); |
| | | } finally { |
| | | HttpRequestLog httpRequestLog = new HttpRequestLog(); |
| | | httpRequestLog.setName(wmsUrl + wmsSystemInUrl); |