提交 5b880b59 编写于 作者: 武汉红喜's avatar 武汉红喜

dependency optimise, slf4j optimise

上级 a062993b
...@@ -42,7 +42,6 @@ ...@@ -42,7 +42,6 @@
<velocity.version>1.7</velocity.version> <velocity.version>1.7</velocity.version>
<velocity-tools.version>2.0</velocity-tools.version> <velocity-tools.version>2.0</velocity-tools.version>
<jackson.version>2.9.5</jackson.version> <jackson.version>2.9.5</jackson.version>
<log4j.version>1.2.17</log4j.version>
<commons-lang.version>2.6</commons-lang.version> <commons-lang.version>2.6</commons-lang.version>
<commons-collections.version>3.2.2</commons-collections.version> <commons-collections.version>3.2.2</commons-collections.version>
<commons-codec.version>1.11</commons-codec.version> <commons-codec.version>1.11</commons-codec.version>
...@@ -102,11 +101,6 @@ ...@@ -102,11 +101,6 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId> <artifactId>jackson-databind</artifactId>
...@@ -117,11 +111,6 @@ ...@@ -117,11 +111,6 @@
<artifactId>jackson-annotations</artifactId> <artifactId>jackson-annotations</artifactId>
<version>${jackson.version}</version> <version>${jackson.version}</version>
</dependency> </dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency> <dependency>
<groupId>commons-lang</groupId> <groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId> <artifactId>commons-lang</artifactId>
......
...@@ -97,18 +97,10 @@ ...@@ -97,18 +97,10 @@
<artifactId>dom4j</artifactId> <artifactId>dom4j</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId> <artifactId>jackson-databind</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
</dependencies> </dependencies>
......
...@@ -58,8 +58,8 @@ ...@@ -58,8 +58,8 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>log4j</groupId> <groupId>ch.qos.logback</groupId>
<artifactId>log4j</artifactId> <artifactId>logback-classic</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>commons-lang</groupId> <groupId>commons-lang</groupId>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<configuration> <configuration>
<settings> <settings>
<setting name="lazyLoadingEnabled" value="false" /> <setting name="lazyLoadingEnabled" value="false" />
<setting name="logImpl" value="LOG4J"/> <setting name="logImpl" value="SLF4J"/>
</settings> </settings>
<typeAliases> <typeAliases>
......
...@@ -40,12 +40,8 @@ ...@@ -40,12 +40,8 @@
<artifactId>fastjson</artifactId> <artifactId>fastjson</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>log4j</groupId> <groupId>ch.qos.logback</groupId>
<artifactId>log4j</artifactId> <artifactId>logback-classic</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.commons</groupId> <groupId>org.apache.commons</groupId>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
## ##
dubbo.container=log4j,spring dubbo.container=logback,spring
dubbo.spring.config=classpath*:META-INF/spring/*.xml dubbo.spring.config=classpath*:META-INF/spring/*.xml
dubbo.application.name=demo-consumer dubbo.application.name=demo-consumer
dubbo.application.owner= dubbo.application.owner=
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright 1999-2011 Alibaba Group.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-->
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="[%d{dd/MM/yy hh:mm:ss:sss z}] %t %5p %c{2}: %m%n" />
</layout>
</appender>
<root>
<level value="INFO" />
<appender-ref ref="CONSOLE" />
</root>
</log4j:configuration>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d %5p %40.40c:%4L - %m%n</pattern>
</encoder>
</appender>
<root level="info">
<appender-ref ref="console" />
</root>
</configuration>
\ No newline at end of file
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId> <artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
......
...@@ -40,12 +40,8 @@ ...@@ -40,12 +40,8 @@
<artifactId>fastjson</artifactId> <artifactId>fastjson</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>log4j</groupId> <groupId>ch.qos.logback</groupId>
<artifactId>log4j</artifactId> <artifactId>logback-classic</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.commons</groupId> <groupId>org.apache.commons</groupId>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
## ##
dubbo.container=log4j,spring dubbo.container=logback,spring
dubbo.spring.config=classpath*:META-INF/spring/*.xml dubbo.spring.config=classpath*:META-INF/spring/*.xml
dubbo.application.name=demo-provider dubbo.application.name=demo-provider
dubbo.application.owner=javahongxi dubbo.application.owner=javahongxi
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright 1999-2011 Alibaba Group.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-->
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="[%d{dd/MM/yy hh:mm:ss:sss z}] %t %5p %c{2}: %m%n" />
</layout>
</appender>
<root>
<level value="INFO" />
<appender-ref ref="CONSOLE" />
</root>
</log4j:configuration>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d %5p %40.40c:%4L - %m%n</pattern>
</encoder>
</appender>
<root level="info">
<appender-ref ref="console" />
</root>
</configuration>
\ No newline at end of file
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<configuration> <configuration>
<settings> <settings>
<setting name="lazyLoadingEnabled" value="false" /> <setting name="lazyLoadingEnabled" value="false" />
<setting name="logImpl" value="LOG4J"/> <!--<setting name="logImpl" value="SLF4J"/>-->
</settings> </settings>
<typeAliases> <typeAliases>
......
...@@ -80,8 +80,9 @@ ...@@ -80,8 +80,9 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>log4j</groupId> <groupId>org.slf4j</groupId>
<artifactId>log4j</artifactId> <artifactId>slf4j-log4j12</artifactId>
<version>1.7.25</version>
</dependency> </dependency>
<dependency> <dependency>
......
package org.hongxi.whatsmars.earth.support.web.service.impl; package org.hongxi.whatsmars.earth.support.web.service.impl;
import org.apache.log4j.Logger;
import org.hongxi.whatsmars.common.ImageSizeEnum; import org.hongxi.whatsmars.common.ImageSizeEnum;
import org.hongxi.whatsmars.common.mongo.GridFSClient; import org.hongxi.whatsmars.common.mongo.GridFSClient;
import org.hongxi.whatsmars.common.pojo.Result; import org.hongxi.whatsmars.common.pojo.Result;
import org.hongxi.whatsmars.common.pojo.ResultCode; import org.hongxi.whatsmars.common.pojo.ResultCode;
import org.hongxi.whatsmars.earth.support.web.service.FileService; import org.hongxi.whatsmars.earth.support.web.service.FileService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -19,7 +20,7 @@ import java.io.InputStream; ...@@ -19,7 +20,7 @@ import java.io.InputStream;
@Service("fileService") @Service("fileService")
public class FileServiceImpl implements FileService { public class FileServiceImpl implements FileService {
protected static final Logger logger = Logger.getLogger(FileService.class); protected static final Logger logger = LoggerFactory.getLogger(FileService.class);
@Autowired @Autowired
private GridFSClient gridFSClient; private GridFSClient gridFSClient;
......
...@@ -47,8 +47,9 @@ ...@@ -47,8 +47,9 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>log4j</groupId> <groupId>org.slf4j</groupId>
<artifactId>log4j</artifactId> <artifactId>slf4j-log4j12</artifactId>
<version>1.7.25</version>
</dependency> </dependency>
<dependency> <dependency>
...@@ -78,11 +79,6 @@ ...@@ -78,11 +79,6 @@
<artifactId>commons-dbcp</artifactId> <artifactId>commons-dbcp</artifactId>
</dependency> </dependency>
<!-- jackson -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId> <artifactId>jackson-databind</artifactId>
...@@ -90,6 +86,7 @@ ...@@ -90,6 +86,7 @@
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId> <artifactId>jackson-annotations</artifactId>
<version>${jackson.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
......
package org.hongxi.whatsmars.earth.web.controller; package org.hongxi.whatsmars.earth.web.controller;
import com.itextpdf.text.log.Logger;
import com.itextpdf.text.log.LoggerFactory;
import org.hongxi.whatsmars.common.pojo.Result; import org.hongxi.whatsmars.common.pojo.Result;
import org.hongxi.whatsmars.common.util.ResultHelper; import org.hongxi.whatsmars.common.util.ResultHelper;
import org.hongxi.whatsmars.earth.service.AccountService; import org.hongxi.whatsmars.earth.service.AccountService;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -21,7 +22,7 @@ import javax.servlet.http.HttpServletResponse; ...@@ -21,7 +22,7 @@ import javax.servlet.http.HttpServletResponse;
@RequestMapping("/account") @RequestMapping("/account")
public class MarsController extends BaseController { public class MarsController extends BaseController {
private Logger accountLogger = Logger.getLogger("account-logger"); private Logger accountLogger = LoggerFactory.getLogger("account-logger");
@Autowired @Autowired
private AccountService accountService; private AccountService accountService;
......
package org.hongxi.whatsmars.earth.web.controller; package org.hongxi.whatsmars.earth.web.controller;
import org.apache.log4j.Logger; import com.itextpdf.text.log.Logger;
import com.itextpdf.text.log.LoggerFactory;
import org.hongxi.whatsmars.common.result.Result; import org.hongxi.whatsmars.common.result.Result;
import org.hongxi.whatsmars.common.result.ResultHelper; import org.hongxi.whatsmars.common.result.ResultHelper;
import org.hongxi.whatsmars.earth.service.UserService; import org.hongxi.whatsmars.earth.service.UserService;
...@@ -19,7 +20,7 @@ import org.hongxi.whatsmars.earth.domain.pojo.User; ...@@ -19,7 +20,7 @@ import org.hongxi.whatsmars.earth.domain.pojo.User;
@RequestMapping("/test") @RequestMapping("/test")
public class NewController { public class NewController {
private final Logger logger = Logger.getLogger(getClass()); private final Logger logger = LoggerFactory.getLogger(getClass());
@Autowired @Autowired
private UserService userService; private UserService userService;
......
...@@ -7,7 +7,6 @@ import org.hongxi.whatsmars.earth.domain.misc.SystemConfig; ...@@ -7,7 +7,6 @@ import org.hongxi.whatsmars.earth.domain.misc.SystemConfig;
import org.hongxi.whatsmars.earth.domain.pojo.User; import org.hongxi.whatsmars.earth.domain.pojo.User;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.springframework.web.servlet.HandlerInterceptor; import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
...@@ -23,8 +22,6 @@ import java.util.Date; ...@@ -23,8 +22,6 @@ import java.util.Date;
*/ */
public class LoginInterceptor implements HandlerInterceptor{ public class LoginInterceptor implements HandlerInterceptor{
protected static final Logger logger = Logger.getLogger(LoginInterceptor.class);
private SystemConfig systemConfig; private SystemConfig systemConfig;
public void setSystemConfig(SystemConfig systemConfig) { public void setSystemConfig(SystemConfig systemConfig) {
......
...@@ -6,7 +6,6 @@ import org.hongxi.whatsmars.earth.domain.permission.Permission; ...@@ -6,7 +6,6 @@ import org.hongxi.whatsmars.earth.domain.permission.Permission;
import org.hongxi.whatsmars.earth.domain.pojo.User; import org.hongxi.whatsmars.earth.domain.pojo.User;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.web.method.HandlerMethod; import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.HandlerInterceptor; import org.springframework.web.servlet.HandlerInterceptor;
...@@ -24,8 +23,6 @@ import java.util.Set; ...@@ -24,8 +23,6 @@ import java.util.Set;
*/ */
public class PermissionInterceptor implements HandlerInterceptor { public class PermissionInterceptor implements HandlerInterceptor {
protected static final Logger logger = Logger.getLogger(PermissionInterceptor.class);
@Override @Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
......
...@@ -16,6 +16,11 @@ ...@@ -16,6 +16,11 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId> <artifactId>spring-boot-starter</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency> <dependency>
<groupId>org.apache.rocketmq</groupId> <groupId>org.apache.rocketmq</groupId>
<artifactId>rocketmq-client</artifactId> <artifactId>rocketmq-client</artifactId>
...@@ -35,11 +40,6 @@ ...@@ -35,11 +40,6 @@
<artifactId>jackson-databind</artifactId> <artifactId>jackson-databind</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency> <dependency>
<groupId>org.projectlombok</groupId> <groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId> <artifactId>lombok</artifactId>
......
...@@ -37,7 +37,6 @@ import org.springframework.beans.BeansException; ...@@ -37,7 +37,6 @@ import org.springframework.beans.BeansException;
import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.BeanDefinitionValidationException; import org.springframework.beans.factory.support.BeanDefinitionValidationException;
import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.beans.factory.support.DefaultListableBeanFactory;
...@@ -51,7 +50,6 @@ import org.springframework.context.ApplicationContextAware; ...@@ -51,7 +50,6 @@ import org.springframework.context.ApplicationContextAware;
import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Role;
import org.springframework.core.annotation.Order; import org.springframework.core.annotation.Order;
import org.springframework.core.env.StandardEnvironment; import org.springframework.core.env.StandardEnvironment;
import org.springframework.util.Assert; import org.springframework.util.Assert;
......
...@@ -27,10 +27,6 @@ ...@@ -27,10 +27,6 @@
<groupId>com.alibaba</groupId> <groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId> <artifactId>fastjson</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId> <artifactId>jackson-databind</artifactId>
...@@ -39,6 +35,7 @@ ...@@ -39,6 +35,7 @@
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId> <artifactId>spring-test</artifactId>
<scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
......
...@@ -20,10 +20,6 @@ ...@@ -20,10 +20,6 @@
</properties> </properties>
<dependencies> <dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency> <dependency>
<groupId>io.shardingjdbc</groupId> <groupId>io.shardingjdbc</groupId>
<artifactId>sharding-jdbc-core-spring-boot-starter</artifactId> <artifactId>sharding-jdbc-core-spring-boot-starter</artifactId>
...@@ -41,10 +37,6 @@ ...@@ -41,10 +37,6 @@
<groupId>mysql</groupId> <groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId> <artifactId>mysql-connector-java</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
</dependency>
<dependency> <dependency>
<groupId>ch.qos.logback</groupId> <groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId> <artifactId>logback-classic</artifactId>
......
...@@ -86,6 +86,12 @@ ...@@ -86,6 +86,12 @@
<groupId>org.hongxi</groupId> <groupId>org.hongxi</groupId>
<artifactId>whatsmars-common</artifactId> <artifactId>whatsmars-common</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
</dependencies> </dependencies>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册