File tree Expand file tree Collapse file tree 6 files changed +60
-5
lines changed
api-boot-samples/api-boot-sample-logging
java/org/minbox/framework/api/boot/sample/logging Expand file tree Collapse file tree 6 files changed +60
-5
lines changed Original file line number Diff line number Diff line change 2222 <parent >
2323 <artifactId >api-boot-samples</artifactId >
2424 <groupId >org.minbox.framework</groupId >
25- <version >2.1.1.RELEASE </version >
25+ <version >2.1.2-SNAPSHOT </version >
2626 </parent >
2727 <modelVersion >4.0.0</modelVersion >
2828 <description >
2929 ApiBoot Logging Sample
3030 </description >
31+ <properties >
32+ <spring .cloud.version>Greenwich.RELEASE</spring .cloud.version>
33+ </properties >
3134 <artifactId >api-boot-sample-logging</artifactId >
3235 <dependencies >
3336 <dependency >
3942 <groupId >org.minbox.framework</groupId >
4043 <artifactId >api-boot-starter-logging</artifactId >
4144 </dependency >
45+ <dependency >
46+ <groupId >org.springframework.cloud</groupId >
47+ <artifactId >spring-cloud-starter-netflix-eureka-client</artifactId >
48+ </dependency >
4249 </dependencies >
4350 <dependencyManagement >
4451 <dependencies >
4552 <dependency >
4653 <groupId >org.minbox.framework</groupId >
4754 <artifactId >api-boot-dependencies</artifactId >
48- <version >2.1.1.RELEASE </version >
55+ <version >2.1.2-SNAPSHOT </version >
4956 <type >pom</type >
5057 <scope >import</scope >
5158 </dependency >
59+ <!-- SpringCloud版本依赖-->
60+ <dependency >
61+ <groupId >org.springframework.cloud</groupId >
62+ <artifactId >spring-cloud-dependencies</artifactId >
63+ <version >${spring.cloud.version} </version >
64+ <scope >import</scope >
65+ <type >pom</type >
66+ </dependency >
5267 </dependencies >
5368 </dependencyManagement >
5469 <build >
Original file line number Diff line number Diff line change 3434 * GitHub:https://github.com/hengboy
3535 */
3636@ SpringBootApplication
37- public class ApiBootLoggingApplication {
37+ public class ApiBootLoggingApplication {
3838 /**
3939 * logger instance
4040 */
Original file line number Diff line number Diff line change 3434 */
3535@ Component
3636public class LocalNoticeSample implements ApiBootLogNotice {
37+ /**
38+ * order 值越小执行越靠前
39+ *
40+ * @return
41+ */
3742 @ Override
3843 public int getOrder () {
3944 return 0 ;
4045 }
4146
47+ /**
48+ * 请求日志通知执行方法
49+ * ApiBootLog为一次请求日志对象基本信息
50+ *
51+ * @param apiBootLog ApiBoot Log
52+ */
4253 @ Override
4354 public void notice (ApiBootLog apiBootLog ) {
4455 System .out .println (apiBootLog );
Original file line number Diff line number Diff line change 1+ api :
2+ boot :
3+ logging :
4+ admin :
5+ server-address : user:123456@127.0.0.1:9090
6+ format-console-log-json : true
7+ number-of-request-log : 2
Original file line number Diff line number Diff line change 1+ api :
2+ boot :
3+ logging :
4+ format-console-log-json : true
5+ number-of-request-log : 2
6+ discovery :
7+ service-id : iot-server-admin
8+ username : admin
9+ password : iot_adminv3
10+ ignore-paths :
11+ - /actuator/health
12+
13+ # Eureka Config
14+ eureka :
15+ client :
16+ service-url :
17+ defaultZone : http://service:nodev2@192.168.10.72:10001/eureka/
18+ instance :
19+ prefer-ip-address : true
Original file line number Diff line number Diff line change 11spring :
22 application :
33 name : api-boot-sample-logging
4-
4+ profiles :
5+ active : appoint
56logging :
67 level :
7- org.minbox.framework.api.boot.plugin.logging : debug
8+ org.minbox.framework.api.boot.plugin.logging : debug
9+ server :
10+ port : 8080
You can’t perform that action at this time.
0 commit comments