WANG 6 rokov pred
rodič
commit
740a633d47

+ 1 - 7
examcloud-exchange-starter/src/main/java/cn/com/qmth/examcloud/exchange/ExchangeApp.java

@@ -3,13 +3,10 @@ package cn.com.qmth.examcloud.exchange;
 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
-import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
 import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
 import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
 import org.springframework.context.annotation.ComponentScan;
 import org.springframework.context.annotation.Configuration;
-import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
-import org.springframework.transaction.annotation.EnableTransactionManagement;
 
 import cn.com.qmth.examcloud.web.bootstrap.AppBootstrap;
 
@@ -23,13 +20,10 @@ import cn.com.qmth.examcloud.web.bootstrap.AppBootstrap;
 
 @SpringBootApplication
 @Configuration
-@EnableJpaAuditing
-@EnableTransactionManagement
 @EnableEurekaClient
 @EnableDiscoveryClient
 @ComponentScan(basePackages = {"cn.com.qmth"})
-@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class,
-		HibernateJpaAutoConfiguration.class})
+@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class})
 public class ExchangeApp {
 
 	static {

+ 6 - 2
examcloud-exchange-starter/src/main/resources/application.properties

@@ -1,2 +1,6 @@
-spring.profiles.active=dev
-config.server.host=config-host
+spring.profiles.active=dev
+
+examcloud.startup.startupCode=8007
+examcloud.startup.configCenterHost=192.168.10.201
+examcloud.startup.configCenterPort=9999
+examcloud.startup.appCode=exchange

+ 69 - 0
examcloud-exchange-starter/src/main/resources/log4j2.xml

@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Configuration status="WARN" monitorInterval="30">
+
+	<Properties>
+		<Property name="commonLevel" value="${sys:log.commonLevel}" />
+	</Properties>
+
+	<Appenders>
+		<!-- 控制台 日志 -->
+		<Console name="Console" target="SYSTEM_OUT">
+			<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS}| %level | %X{TRACE_ID} - %X{CALLER} | %m | %l%n" />
+		</Console>
+		<!-- debug 日志 -->
+		<RollingFile name="DEBUG_APPERDER" fileName="./logs/debug/debug.log"
+			filePattern="./logs/debug/debug-%d{yyyy.MM.dd.HH}-%i.log">
+			<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS}| %level | %X{TRACE_ID} - %X{CALLER} | %m | %l%n" />
+			<Policies>
+				<TimeBasedTriggeringPolicy interval="1" />
+				<SizeBasedTriggeringPolicy size="100MB" />
+			</Policies>
+			<DefaultRolloverStrategy max="10">
+				<Delete basePath="./logs/debug" maxDepth="1">
+					<IfFileName glob="debug-*.log" />
+					<IfLastModified age="24H" />
+				</Delete>
+			</DefaultRolloverStrategy>
+		</RollingFile>
+		<!-- 接口日志 -->
+		<RollingFile name="INTERFACE_APPENDER" fileName="./logs/interface/interface.log"
+			filePattern="./logs/interface/interface-%d{yyyy.MM.dd.HH}-%i.log">
+			<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS}| %level | %X{TRACE_ID} - %X{CALLER} | %m%n" />
+			<Policies>
+				<TimeBasedTriggeringPolicy interval="1" />
+				<SizeBasedTriggeringPolicy size="100MB" />
+			</Policies>
+			<DefaultRolloverStrategy max="10">
+				<Delete basePath="./logs/interface" maxDepth="1">
+					<IfFileName glob="interface-*.log" />
+					<IfLastModified age="24H" />
+				</Delete>
+			</DefaultRolloverStrategy>
+		</RollingFile>
+	</Appenders>
+
+	<Loggers>
+		<Logger name="cn.com.qmth" level="${commonLevel}" additivity="false">
+			<AppenderRef ref="DEBUG_APPERDER" />
+			<AppenderRef ref="Console" />
+		</Logger>
+
+		<Logger name="INTERFACE_LOGGER" level="INFO" additivity="false">
+			<AppenderRef ref="INTERFACE_APPENDER" />
+			<AppenderRef ref="Console" />
+		</Logger>
+
+		<Logger name="org.hibernate.type.descriptor.sql.BasicBinder" level="${commonLevel}" />
+		<Logger name="org.hibernate.type.descriptor.sql.BasicExtractor" level="${commonLevel}" />
+		<Logger name="org.hibernate.SQL" level="${commonLevel}" />
+		<Logger name="org.hibernate.type" level="${commonLevel}" />
+		<Logger name="org.hibernate.engine.QueryParameters" level="${commonLevel}" />
+		<Logger name="org.hibernate.engine.query.HQLQueryPlan" level="${commonLevel}" />
+
+		<Root level="INFO">
+			<AppenderRef ref="Console" />
+			<AppenderRef ref="DEBUG_APPERDER" />
+		</Root>
+	</Loggers>
+
+</Configuration>