添加eureka注册中心支持
This commit is contained in:
@@ -2,7 +2,9 @@ package com.macro.mall;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
|
||||
@EnableDiscoveryClient
|
||||
@SpringBootApplication
|
||||
public class MallDemoApplication{
|
||||
public static void main(String[] args) {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
server:
|
||||
port: 8082
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: mall-demo
|
||||
datasource:
|
||||
url: jdbc:mysql://localhost:3306/mall?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
@@ -12,19 +13,22 @@ spring:
|
||||
servlet:
|
||||
content-type: text/html
|
||||
cache: false #开发时关闭缓存,不然没法看到实时页面
|
||||
|
||||
mybatis:
|
||||
mapper-locations:
|
||||
- classpath:mapper/*.xml
|
||||
- classpath*:com/**/mapper/*.xml
|
||||
|
||||
logging:
|
||||
level:
|
||||
root: info #日志配置DEBUG,INFO,WARN,ERROR
|
||||
com.macro.mall: debug
|
||||
# file: demo_log.log #配置日志生成路径
|
||||
# path: /var/logs #配置日志文件名称
|
||||
|
||||
host:
|
||||
mall:
|
||||
admin: http://localhost:8080
|
||||
eureka:
|
||||
client:
|
||||
register-with-eureka: true
|
||||
fetch-registry: true
|
||||
service-url:
|
||||
defaultZone: http://localhost:8001/eureka/
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
<encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder" />
|
||||
</appender>
|
||||
<root level="INFO">
|
||||
<!--使用logstash时打开-->
|
||||
<appender-ref ref="LOGSTASH" />
|
||||
<appender-ref ref="CONSOLE" />
|
||||
</root>
|
||||
|
||||
Reference in New Issue
Block a user