Skip to content

Commit

Permalink
Add nacos log config in demo
Browse files Browse the repository at this point in the history
  • Loading branch information
hexiaofeng committed Jun 3, 2024
1 parent afa1137 commit b3a16f5
Show file tree
Hide file tree
Showing 16 changed files with 96 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package com.jd.live.agent.demo.dubbo.v2_7.consumer;

import com.alibaba.nacos.client.config.utils.SnapShotSwitch;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
Expand All @@ -24,6 +25,7 @@
public class Dubbo27Consumer {

public static void main(String[] args) {
SnapShotSwitch.setIsSnapShot(false);
SpringApplication.run(Dubbo27Consumer.class, args);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false" scan="false">
<!-- Console log output -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender"/>

<!-- Level: TRACE < DEBUG < INFO < WARN < ERROR < FATAL -->
<root level="info">
<appender-ref ref="console"/>
</root>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package com.jd.live.agent.demo.dubbo.v2_7.provider;

import com.alibaba.nacos.client.config.utils.SnapShotSwitch;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
Expand All @@ -25,6 +26,7 @@
@EnableDubbo(scanBasePackages = {"com.jd.live.agent.demo.dubbo.v2_7.provider.service"})
public class Dubbo27Provider {
public static void main(String[] args) throws Exception {
SnapShotSwitch.setIsSnapShot(false);
SpringApplication.run(Dubbo27Provider.class, args);
System.out.println("dubbo2.7 provider started");
new CountDownLatch(1).await();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false" scan="false">
<!-- Console log output -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender"/>

<!-- Level: TRACE < DEBUG < INFO < WARN < ERROR < FATAL -->
<root level="info">
<appender-ref ref="console"/>
</root>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package com.jd.live.agent.demo.v3.consumer;

import com.alibaba.nacos.client.config.utils.SnapShotSwitch;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
Expand All @@ -26,6 +27,7 @@
public class Dubbo3Consumer {

public static void main(String[] args) {
SnapShotSwitch.setIsSnapShot(false);
SpringApplication.run(Dubbo3Consumer.class, args);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false" scan="false">
<!-- Console log output -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender"/>

<!-- Level: TRACE < DEBUG < INFO < WARN < ERROR < FATAL -->
<root level="info">
<appender-ref ref="console"/>
</root>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package com.jd.live.agent.demo.dubbo.v3.provider;

import com.alibaba.nacos.client.config.utils.SnapShotSwitch;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
Expand All @@ -25,6 +26,7 @@
@EnableDubbo(scanBasePackages = {"com.jd.live.agent.demo.dubbo.v3.provider.service"})
public class Dubbo3Provider {
public static void main(String[] args) throws Exception {
SnapShotSwitch.setIsSnapShot(false);
SpringApplication.run(Dubbo3Provider.class, args);
System.out.println("dubbo3 provider started");
new CountDownLatch(1).await();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false" scan="false">
<!-- Console log output -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender"/>

<!-- Level: TRACE < DEBUG < INFO < WARN < ERROR < FATAL -->
<root level="info">
<appender-ref ref="console"/>
</root>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package com.jd.live.agent.demo.rocketmq;

import com.alibaba.nacos.client.config.utils.SnapShotSwitch;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
Expand All @@ -24,6 +25,7 @@
public class RocketmqApplication {

public static void main(String[] args) {
SnapShotSwitch.setIsSnapShot(false);
SpringApplication.run(RocketmqApplication.class, args);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false" scan="false">
<!-- Console log output -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender"/>

<!-- Level: TRACE < DEBUG < INFO < WARN < ERROR < FATAL -->
<root level="info">
<appender-ref ref="console"/>
</root>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package com.jd.live.agent.demo.springcloud.v3.consumer;

import com.alibaba.nacos.client.config.utils.SnapShotSwitch;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
Expand All @@ -26,6 +27,7 @@
public class SpringCloud3Consumer {

public static void main(String[] args) {
SnapShotSwitch.setIsSnapShot(false);
SpringApplication.run(SpringCloud3Consumer.class, args);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false" scan="false">
<!-- Console log output -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender"/>

<!-- Level: TRACE < DEBUG < INFO < WARN < ERROR < FATAL -->
<root level="info">
<appender-ref ref="console"/>
</root>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@
*/
package com.jd.live.agent.demo.springcloud.v3.gateway;

import com.alibaba.nacos.client.config.utils.SnapShotSwitch;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class SpringCloud3Gateway {

public static void main(String[] args) {
SnapShotSwitch.setIsSnapShot(false);
SpringApplication.run(SpringCloud3Gateway.class, args);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false" scan="false">
<!-- Console log output -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender"/>

<!-- Level: TRACE < DEBUG < INFO < WARN < ERROR < FATAL -->
<root level="info">
<appender-ref ref="console"/>
</root>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package com.jd.live.agent.demo.springcloud.v3.provider;

import com.alibaba.nacos.client.config.utils.SnapShotSwitch;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
Expand All @@ -24,6 +25,7 @@
public class SpringCloud3Provider {

public static void main(String[] args) {
SnapShotSwitch.setIsSnapShot(false);
SpringApplication.run(SpringCloud3Provider.class, args);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false" scan="false">
<!-- Console log output -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender"/>

<!-- Level: TRACE < DEBUG < INFO < WARN < ERROR < FATAL -->
<root level="info">
<appender-ref ref="console"/>
</root>
</configuration>

0 comments on commit b3a16f5

Please sign in to comment.