Commit 2052b3f1 authored by wujiang's avatar wujiang

修改日志打印

parent b8c40195
package com.yeejoin.amos.boot.module.hygf.api.config;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Primary;
import org.springframework.http.HttpStatus;
import org.springframework.validation.BindException;
import org.springframework.validation.BindingResult;
import org.springframework.validation.FieldError;
import org.springframework.validation.ObjectError;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.multipart.MaxUploadSizeExceededException;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
* @description: 全局异常处理器
* @author: duanwei
* @create: 2019-08-28 20:07
**/
@RestControllerAdvice
@Slf4j
@Primary
public class GlobalExceptionHandler {
/**
* 校验异常统一拦截地方
*
* @param e
* @return
*/
@ExceptionHandler({ Exception.class })
@ResponseBody
public ResponseModel<Object> handleException(Exception e) {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
.getRequest();
ResponseModel<Object> response = new ResponseModel<>();
response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
response.setTraceId(RequestContext.getTraceId());
response.setPath(request.getServletPath());
response.setDevMessage(e.getMessage());
response.setMessage(e.getMessage());
return response;
}
}
\ No newline at end of file
package com.yeejoin.amos; package com.yeejoin.amos;
import com.yeejoin.amos.boot.biz.common.utils.oConvertUtils; import java.net.InetAddress;
import org.mybatis.spring.annotation.MapperScan; import org.mybatis.spring.annotation.MapperScan;
import org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration; import org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -16,14 +17,14 @@ import org.springframework.cloud.netflix.eureka.EnableEurekaClient; ...@@ -16,14 +17,14 @@ import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.typroject.tyboot.core.restful.exception.GlobalExceptionHandler; import org.typroject.tyboot.core.restful.exception.GlobalExceptionHandler;
import java.net.InetAddress; import com.yeejoin.amos.boot.biz.common.utils.oConvertUtils;
/** /**
* <pre> * <pre>
...@@ -42,17 +43,20 @@ import java.net.InetAddress; ...@@ -42,17 +43,20 @@ import java.net.InetAddress;
@EnableScheduling @EnableScheduling
@MapperScan({ "org.typroject.tyboot.demo.face.orm.dao*", "org.typroject.tyboot.face.*.orm.dao*", @MapperScan({ "org.typroject.tyboot.demo.face.orm.dao*", "org.typroject.tyboot.face.*.orm.dao*",
"org.typroject.tyboot.core.auth.face.orm.dao*", "org.typroject.tyboot.component.*.face.orm.dao*", "org.typroject.tyboot.core.auth.face.orm.dao*", "org.typroject.tyboot.component.*.face.orm.dao*",
"com.yeejoin.amos.boot.module.**.api.tdenginemapper","com.yeejoin.amos.boot.module.**.api.mapper", "com.yeejoin.amos.boot.biz.common.dao.mapper","com.yeejoin.amos.boot.module.common.biz.*" }) "com.yeejoin.amos.boot.module.**.api.tdenginemapper", "com.yeejoin.amos.boot.module.**.api.mapper",
@ComponentScan(basePackages = { "org.typroject", "com.yeejoin.amos" }) "com.yeejoin.amos.boot.biz.common.dao.mapper", "com.yeejoin.amos.boot.module.common.biz.*" })
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, DataSourceTransactionManagerAutoConfiguration.class, MybatisAutoConfiguration.class}) @ComponentScan(basePackages = { "org.typroject",
"com.yeejoin.amos" }, excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {
GlobalExceptionHandler.class }))
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class,
DataSourceTransactionManagerAutoConfiguration.class, MybatisAutoConfiguration.class })
public class AmosHygfApplication { public class AmosHygfApplication {
private static final Logger logger = LoggerFactory.getLogger(AmosHygfApplication.class); private static final Logger logger = LoggerFactory.getLogger(AmosHygfApplication.class);
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
ConfigurableApplicationContext context = SpringApplication.run(AmosHygfApplication.class, args); ConfigurableApplicationContext context = SpringApplication.run(AmosHygfApplication.class, args);
GlobalExceptionHandler.setAlwaysOk(true); GlobalExceptionHandler.setAlwaysOk(true);
Environment env = context.getEnvironment(); Environment env = context.getEnvironment();
String ip = InetAddress.getLocalHost().getHostAddress(); String ip = InetAddress.getLocalHost().getHostAddress();
String port = env.getProperty("server.port"); String port = env.getProperty("server.port");
......
...@@ -54,6 +54,7 @@ public class AcceptanceRectificationOrderServiceImpl extends BaseService<Accepta ...@@ -54,6 +54,7 @@ public class AcceptanceRectificationOrderServiceImpl extends BaseService<Accepta
return acceptanceRectificationOrderMapper.page(page, acceptanceSeqNbr); return acceptanceRectificationOrderMapper.page(page, acceptanceSeqNbr);
} }
/** /**
* 列表查询 示例 * 列表查询 示例
*/ */
......
...@@ -213,7 +213,7 @@ public class QiyuesuoServiceImpl { ...@@ -213,7 +213,7 @@ public class QiyuesuoServiceImpl {
List<Stamper> stampers = new ArrayList<>(); List<Stamper> stampers = new ArrayList<>();
stampers.add(stamper); stampers.add(stamper);
stampers.add(stamper2); stampers.add(stamper2);
SdkResponse<Object> data = this.getSdkResponse(result.getId(), stampers); //SdkResponse<Object> data = this.getSdkResponse(result.getId(), stampers);
return result.getId(); return result.getId();
} }
......
...@@ -172,16 +172,16 @@ hygf.user.group.empty=1775056568031645697 ...@@ -172,16 +172,16 @@ hygf.user.group.empty=1775056568031645697
qiyuesuo.serverUrl = https://openapi.qiyuesuo.cn #qiyuesuo.serverUrl = https://openapi.qiyuesuo.cn
qiyuesuo.accessKey = a1lcd3WRRV #qiyuesuo.accessKey = a1lcd3WRRV
qiyuesuo.accessSecret = haqYIOxTP20ZYiDNEN92GVBa6aoJLu #qiyuesuo.accessSecret = haqYIOxTP20ZYiDNEN92GVBa6aoJLu
qiyuesuo.secretKey=Fp2LQAqK5gc68hi5 #qiyuesuo.secretKey=Fp2LQAqK5gc68hi5
#qiyuesuo.serverUrl = https://openapi.qiyuesuo.com qiyuesuo.serverUrl = https://openapi.qiyuesuo.com
#qiyuesuo.accessKey = QcmHQu55pl qiyuesuo.accessKey = QcmHQu55pl
#qiyuesuo.accessSecret = em0zvOMRNCAXoD1ePNTL7hGR5KpKUs qiyuesuo.accessSecret = em0zvOMRNCAXoD1ePNTL7hGR5KpKUs
#qiyuesuo.secretKey=B6OYbHyfXikAghB2 qiyuesuo.secretKey=B6OYbHyfXikAghB2
......
## DB properties:
spring.datasource.dynamic.primary= mysql-service
spring.datasource.mysql-service.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.mysql-service.jdbc-url=jdbc:mysql://10.20.1.157:3306/amos_project?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.datasource.mysql-service.username=root
spring.datasource.mysql-service.password=Yeejoin@2020
spring.datasource.mysql-service.type=com.zaxxer.hikari.HikariDataSource
#最小连接
spring.datasource.mysql-service.minimum-idle: 5
#最大连接
spring.datasource.mysql-service.maximum-pool-size: 15
#自动提交
spring.datasource.mysql-service.auto-commit: true
#最大空闲时常
spring.datasource.mysql-service.idle-timeout: 30000
#连接池名
spring.datasource.mysql-service.pool-name: MysqlDruidCP
#最大生命周期
spring.datasource.mysql-service.max-lifetime: 1800000
#连接超时时间
spring.datasource.mysql-service.connection-timeout: 30000
spring.datasource.tdengine-service.driver-class-name=com.taosdata.jdbc.rs.RestfulDriver
spring.datasource.tdengine-service.jdbc-url=jdbc:TAOS-RS://47.92.234.253:6041/house_pv_data?user=root&password=taosdata&timezone=GMT+8
spring.datasource.tdengine-service.username=root
spring.datasource.tdengine-service.password=taosdata
spring.datasource.tdengine-service.type=com.zaxxer.hikari.HikariDataSource
#最小连接
spring.datasource.tdengine-service.minimum-idle: 5
#最大连接
spring.datasource.tdengine-service.maximum-pool-size: 15
#自动提交
spring.datasource.tdengine-service.auto-commit: true
#最大空闲时常
spring.datasource.tdengine-service.idle-timeout: 30000
#连接池名
spring.datasource.tdengine-service.pool-name: Data_trans_HikariCP
#最大生命周期
spring.datasource.tdengine-service.max-lifetime: 1800000
#连接超时时间
spring.datasource.tdengine-service.connection-timeout: 30000
spring.datasource.tdengine-service.connection-test-query: SELECT 1
## eureka properties:
eureka.instance.hostname=47.92.234.253
eureka.client.serviceUrl.defaultZone=http://admin:a1234560@${eureka.instance.hostname}:10001/eureka/
## redis properties:
spring.redis.database=1
spring.redis.host=47.92.234.253
spring.redis.port=6379
spring.redis.password=yeejoin@2020
spring.cache.type=GENERIC
j2cache.open-spring-cache=true
j2cache.cache-clean-mode=passive
j2cache.allow-null-values=true
j2cache.redis-client=lettuce
j2cache.l2-cache-open=true
j2cache.broadcast=net.oschina.j2cache.cache.support.redis.SpringRedisPubSubPolicy
j2cache.L1.provider_class=caffeine
j2cache.L2.provider_class=net.oschina.j2cache.cache.support.redis.SpringRedisProvider
j2cache.L2.config_section=lettuce
j2cache.sync_ttl_to_redis=true
j2cache.default_cache_null_object=false
j2cache.serialization=fst
caffeine.properties=/caffeine.properties
lettuce.mode=single
lettuce.namespace=
lettuce.storage=generic
lettuce.channel=j2cache
lettuce.scheme=redis
lettuce.hosts=${spring.redis.host}:${spring.redis.port}
lettuce.password=${spring.redis.password}
lettuce.database=${spring.redis.database}
lettuce.sentinelMasterId=
lettuce.maxTotal=100
lettuce.maxIdle=10
lettuce.minIdle=10
lettuce.timeout=10000
emqx.clean-session=true
emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
emqx.broker=tcp://47.92.234.253:1883
emqx.user-name=admin
emqx.password=public
emqx.max-inflight=1000
spring.influx.url=http://47.92.234.253:8086
spring.influx.password=Yeejoin@2020
spring.influx.user=root
spring.influx.database=iot_platform
spring.influx.retention_policy=default
spring.influx.retention_policy_time=30d
spring.influx.actions=10000
spring.influx.bufferLimit=20000
knife4j.production=false
knife4j.enable=true
knife4j.basic.enable=true
knife4j.basic.username=admin
knife4j.basic.password=a1234560
management.security.enabled=true
spring.security.user.name=admin
spring.security.user.password=a1234560
fire-rescue=123
mybatis-plus.global-config.db-config.update-strategy=ignored
# user-amos setting : This value is the secretkey for person manage moudle accout password encryption.please don't change it!!!
amos.secret.key=qaz
# if your service can't be access ,you can use this setting , you need change ip as your.
#eureka.instance.prefer-ip-address=true
#eureka.instance.ip-address=172.16.3.122
spring.activemq.broker-url=tcp://47.92.234.253:61616
spring.activemq.user=admin
spring.activemq.password=admin
spring.jms.pub-sub-domain=false
myqueue=amos.privilege.v1.JXIOP.AQSC_FDGL.userBusiness
regulator.unit.code=86*258
# ������Ӧ��code
dealer.appcode=studio_normalapp_5133538
hygf.sms.tempCode=SMS_HYGF_0001
# �������������
sms.huawei.url=https://smsapi.cn-north-4.myhuaweicloud.com:443/sms/batchSendSms/v1
sms.huawei.appKey=n3FYPWO7Heo1ze212QRBvF4VA2E2
sms.huawei.appSecret=IFhiMpWROi7w4Ei21ZbfIjKyt97b
# �id
sms.huawei.templateId=67931857f6f74e119fadc429bc25a531
# ǩ��ͨ����
sms.huawei.sender=1069368924410006092
# 签名名称
sms.huawei.signature=江西电建
# 锟斤拷站锟斤拷锟絧ageId
power.station.examine.pageId=1680853427061551106
# 锟斤拷站锟斤拷思苹锟絠d
power.station.examine.planId=c4ed1873-0dc6-4518-a7a9-dbc588ef35e5
unitInfo.station.examine.planId=51776087-a9cf-4a87-9a03-24fd24a8cf45
hygf.sms.tempCodeJXS=SMS_HYGF_0002
#工程角色id
hygf.role.gc.roleSeq=1702550832882413570
# 锟矫伙拷锟斤拷userGroupId
hygf.user.group.id=1702512164058718210
#锟斤拷锟斤拷司
regionalCompanies.company.seq=1701778292098498561
hygf.user.group.empty=1775056568031645697
#qiyuesuo.serverUrl = https://openapi.qiyuesuo.cn
#qiyuesuo.accessKey = a1lcd3WRRV
#qiyuesuo.accessSecret = haqYIOxTP20ZYiDNEN92GVBa6aoJLu
#qiyuesuo.secretKey=Fp2LQAqK5gc68hi5
qiyuesuo.serverUrl = https://openapi.qiyuesuo.com
qiyuesuo.accessKey = QcmHQu55pl
qiyuesuo.accessSecret = em0zvOMRNCAXoD1ePNTL7hGR5KpKUs
qiyuesuo.secretKey=B6OYbHyfXikAghB2
# ============================================= v20230821 add properties =============================================
security.productWeb=AMOS_STUDIO_WEB
security.appKey=AMOS_STUDIO
login.environment=dev
# 锟斤拷锟脚╋拷锟轿拷锟叫★拷锟斤拷锟斤拷锟斤拷?
hygfProgram.appid=wx0a2b054a237a3b34
hygfProgram.secret=5fc6af660920f6211b1b69bc9c451b09
# 默锟斤拷微锟斤拷小锟斤拷锟斤拷农锟斤拷锟斤拷锟斤拷锟斤拷
farmer.orgCode=86
#农锟斤拷锟斤拷锟斤拷锟斤拷位
farmer.sequenceNbr=1703583838279593985
farmer.orgNamesWithoutRole=
#农锟斤拷锟斤拷色
farmer.roleId=1702551322030534658
# 锟斤拷锟矫接匡拷锟斤拷权锟矫伙拷
platform.access.loginId=hygf_platform
platform.access.password=AC286A35E74D2DD281EB979789DECF3A
# 锟斤拷锟斤拷锟矫的撅拷锟斤拷锟斤拷userid
dealer.userId=
# 锟斤拷锟皆碉拷时锟斤拷默锟斤拷锟斤拷锟斤拷
farmer.registerPassword=a123456
#锟斤拷锟斤拷锟教碉拷位锟斤拷锟节碉拷id
dealer.managementUnitId=1702211822385393665
#锟斤拷锟斤拷锟教癸拷锟斤拷员锟斤拷色
dealer.roleId=1702512164058718210
#锟斤拷询锟斤拷锟斤拷锟斤拷锟矫伙拷锟斤拷
dealer.group=1702511386875158529
#锟斤拷锟矫癸拷锟斤拷锟斤拷探锟斤拷?
dealer.engineering=1702512052154687489
#锟斤拷时锟斤拷锟斤拷锟饺★拷锟斤拷锟斤拷锟较?
cheduled.crons=0 10 0 * * ?
dealer.appcode.manage=studio_normalapp_5155413,studio_normalapp_5133538
dealer.appcode.role=1767363928842571777
dealer.amosDealerId=1767820997374775298
\ No newline at end of file
...@@ -2,7 +2,7 @@ spring.application.name=AMOS-HYGF-CAOTAO ...@@ -2,7 +2,7 @@ spring.application.name=AMOS-HYGF-CAOTAO
server.servlet.context-path=/hygf server.servlet.context-path=/hygf
server.port=33330 server.port=33330
server.uri-encoding=UTF-8 server.uri-encoding=UTF-8
spring.profiles.active=dev spring.profiles.active=dev1
spring.jackson.time-zone=GMT+8 spring.jackson.time-zone=GMT+8
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
logging.config=classpath:logback-${spring.profiles.active}.xml logging.config=classpath:logback-${spring.profiles.active}.xml
......
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false">
<!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径-->
<property name="LOG_HOME" value="log" />
<property name="LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %-50.50logger{50} - %msg [%file:%line] %n" />
<!-- 按照每天生成日志文件 -->
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!--日志文件输出的文件名-->
<FileNamePattern>${LOG_HOME}/ccs.log.%d{yyyy-MM-dd}.log</FileNamePattern>
<!--日志文件保留天数-->
<MaxHistory>7</MaxHistory>
</rollingPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<pattern>${LOG_PATTERN}</pattern>
</encoder>
<!--日志文件最大的大小-->
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>30mb</MaxFileSize>
</triggeringPolicy>
</appender>
<!-- 控制台输出 -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<pattern>${LOG_PATTERN}</pattern>
</encoder>
</appender>
<!--myibatis log configure-->
<logger name="com.apache.ibatis" level="DEBUG"/>
<logger name="java.sql.Connection" level="DEBUG"/>
<logger name="java.sql.Statement" level="DEBUG"/>
<logger name="java.sql.PreparedStatement" level="DEBUG"/>
<logger name="com.baomidou.mybatisplus" level="DEBUG"/>
<logger name="org.springframework" level="DEBUG"/>
<logger name="org.typroject" level="DEBUG"/>
<logger name="com.yeejoin" level="DEBUG"/>
<!-- 日志输出级别 -->
<root level="INFO">
<appender-ref ref="FILE" />
<appender-ref ref="STDOUT" />
</root>
</configuration>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment