Skip to content

Commit

Permalink
Polish alibaba#101
Browse files Browse the repository at this point in the history
  • Loading branch information
mercyblitz committed Oct 1, 2018
1 parent be8f3c2 commit 99b5827
Show file tree
Hide file tree
Showing 15 changed files with 769 additions and 1,573 deletions.
14 changes: 14 additions & 0 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,20 @@
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
</dependency>


<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<scope>test</scope>
</dependency>

</dependencies>

</project>
53 changes: 0 additions & 53 deletions api/src/test/java/com/alibaba/nacos/client/AppTest.java

This file was deleted.

27 changes: 3 additions & 24 deletions client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,49 +33,26 @@
</properties>

<dependencies>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<optional>true</optional>
</dependency>

<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<optional>true</optional>
</dependency>

<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.8.2</version>
<optional>true</optional>
</dependency>

<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<optional>true</optional>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<optional>true</optional>
</dependency>

<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<optional>true</optional>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<optional>true</optional>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>nacos-common</artifactId>
Expand All @@ -94,11 +71,13 @@
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<optional>true</optional>
</dependency>

<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<optional>true</optional>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@
*/
package com.alibaba.nacos.client.logger;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import com.alibaba.nacos.client.logger.log4j.Log4jLoggerFactory;
import com.alibaba.nacos.client.logger.log4j2.Log4j2LoggerFactory;
import com.alibaba.nacos.client.logger.nop.NopLoggerFactory;
import com.alibaba.nacos.client.logger.slf4j.Slf4jLoggerFactory;
import com.alibaba.nacos.client.logger.support.ILoggerFactory;
import com.alibaba.nacos.client.logger.support.LogLog;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
* <pre>
* 阿里中间件LoggerFactory,获取具体日志实现
Expand Down Expand Up @@ -57,17 +56,12 @@ private LoggerFactory() {
LogLog.info("Init JM logger with Slf4jLoggerFactory success, " + LoggerFactory.class.getClassLoader());
} catch (Throwable e1) {
try {
setLoggerFactory(new Log4jLoggerFactory());
LogLog.info("Init JM logger with Log4jLoggerFactory, " + LoggerFactory.class.getClassLoader());
setLoggerFactory(new Log4j2LoggerFactory());
LogLog.info("Init JM logger with Log4j2LoggerFactory, " + LoggerFactory.class.getClassLoader());
} catch (Throwable e2) {
try {
setLoggerFactory(new Log4j2LoggerFactory());
LogLog.info("Init JM logger with Log4j2LoggerFactory, " + LoggerFactory.class.getClassLoader());
} catch (Throwable e3) {
setLoggerFactory(new NopLoggerFactory());
LogLog.warn("Init JM logger with NopLoggerFactory, pay attention. "
+ LoggerFactory.class.getClassLoader(), e2);
}
setLoggerFactory(new NopLoggerFactory());
LogLog.warn("Init JM logger with NopLoggerFactory, pay attention. "
+ LoggerFactory.class.getClassLoader(), e2);
}
}

Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
*/
package com.alibaba.nacos.client.logger.option;

import org.apache.log4j.AsyncAppender;

import com.alibaba.nacos.client.logger.Level;
import com.alibaba.nacos.client.logger.support.LogLog;

Expand Down
Loading

0 comments on commit 99b5827

Please sign in to comment.