Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
matrix
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
mall
arch
matrix
Commits
34cbd1f9
Commit
34cbd1f9
authored
Aug 01, 2019
by
QIANGLU
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add log-starter
parent
8e2a4e65
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
143 additions
and
72 deletions
+143
-72
README.md
README.md
+8
-2
pom.xml
logger-starter/pom.xml
+43
-36
pom.xml
logger-starter/secoo-log-starter/pom.xml
+46
-0
logback-spring.xml
logger-starter/secoo-log-starter/src/main/resources/logback-spring.xml
+4
-22
pom.xml
logger-starter/secoo-log/pom.xml
+41
-0
logback.xml
logger-starter/secoo-log/src/main/resources/logback.xml
+1
-1
MatrixRocketMQAutoConfiguration.java
rocketmq-starter/src/main/java/com/secoo/mall/mq/config/MatrixRocketMQAutoConfiguration.java
+0
-11
No files found.
README.md
View file @
34cbd1f9
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
+-- dubbo-starter
+-- dubbo-starter
+-- web-starter
+-- web-starter
```
```
重要版本说明
说明:
说明:
...
@@ -25,8 +26,13 @@
...
@@ -25,8 +26,13 @@
*
\*
-starter:组件依赖
*
\*
-starter:组件依赖
开发版本 1.0.6-DEV-SNAPSHOT
版本升级须知
当前开发版本 1.0.6-DEV-SNAPSHOT
1、rocketmq-starter 兼容Apollo
1、rocketmq-starter 兼容Apollo
2、新增rocketmq 发送/接收,消息监听
正式版本
正式版本
1.
0.4.RELEASE
1.
0.4.RELEASE
...
@@ -42,6 +48,6 @@
...
@@ -42,6 +48,6 @@
1.
0.2.RELEASE
1.
0.2.RELEASE
init code
logger-starter/pom.xml
View file @
34cbd1f9
...
@@ -10,7 +10,11 @@
...
@@ -10,7 +10,11 @@
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
logger-starter
</artifactId>
<artifactId>
logger-starter
</artifactId>
<packaging>
pom
</packaging>
<modules>
<module>
secoo-log
</module>
<module>
secoo-log-starter
</module>
</modules>
<properties>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<logback.version>
1.2.3
</logback.version>
<logback.version>
1.2.3
</logback.version>
...
@@ -18,39 +22,41 @@
...
@@ -18,39 +22,41 @@
<janino.version>
3.0.6
</janino.version>
<janino.version>
3.0.6
</janino.version>
</properties>
</properties>
<dependencies>
<dependencyManagement>
<dependency>
<dependencies>
<groupId>
org.slf4j
</groupId>
<dependency>
<artifactId>
slf4j-api
</artifactId>
<groupId>
org.slf4j
</groupId>
<version>
${slf4j.version}
</version>
<artifactId>
slf4j-api
</artifactId>
</dependency>
<version>
${slf4j.version}
</version>
<dependency>
</dependency>
<groupId>
ch.qos.logback
</groupId>
<dependency>
<artifactId>
logback-classic
</artifactId>
<groupId>
ch.qos.logback
</groupId>
<version>
${logback.version}
</version>
<artifactId>
logback-classic
</artifactId>
</dependency>
<version>
${logback.version}
</version>
<!-- 桥接slf4j -->
</dependency>
<dependency>
<!-- 桥接slf4j -->
<groupId>
org.slf4j
</groupId>
<dependency>
<artifactId>
jcl-over-slf4j
</artifactId>
<groupId>
org.slf4j
</groupId>
<version>
${slf4j.version}
</version>
<artifactId>
jcl-over-slf4j
</artifactId>
</dependency>
<version>
${slf4j.version}
</version>
<dependency>
</dependency>
<groupId>
org.slf4j
</groupId>
<dependency>
<artifactId>
log4j-over-slf4j
</artifactId>
<groupId>
org.slf4j
</groupId>
<version>
${slf4j.version}
</version>
<artifactId>
log4j-over-slf4j
</artifactId>
</dependency>
<version>
${slf4j.version}
</version>
<!-- 支持logback condition表达式 -->
</dependency>
<dependency>
<!-- 支持logback condition表达式 -->
<groupId>
org.codehaus.janino
</groupId>
<dependency>
<artifactId>
janino
</artifactId>
<groupId>
org.codehaus.janino
</groupId>
<version>
${janino.version}
</version>
<artifactId>
janino
</artifactId>
</dependency>
<version>
${janino.version}
</version>
<!-- 打印skywalking tid插件-->
</dependency>
<dependency>
<!-- 打印skywalking tid插件-->
<groupId>
org.apache.skywalking
</groupId>
<dependency>
<artifactId>
apm-toolkit-logback-1.x
</artifactId>
<groupId>
org.apache.skywalking
</groupId>
<version>
6.2.1-beta.RELEASE
</version>
<artifactId>
apm-toolkit-logback-1.x
</artifactId>
</dependency>
<version>
6.2.1-beta.RELEASE
</version>
</dependencies>
</dependency>
</dependencies>
</dependencyManagement>
</project>
</project>
\ No newline at end of file
logger-starter/secoo-log-starter/pom.xml
0 → 100644
View file @
34cbd1f9
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
logger-starter
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<version>
1.0.6-DEV-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
secoo-log-starter
</artifactId>
<name>
${project.artifactId}
</name>
<properties>
<spring.boot.version>
2.0.5.RELEASE
</spring.boot.version>
</properties>
<dependencies>
<dependency>
<groupId>
org.slf4j
</groupId>
<artifactId>
slf4j-api
</artifactId>
</dependency>
<dependency>
<groupId>
ch.qos.logback
</groupId>
<artifactId>
logback-classic
</artifactId>
</dependency>
<!-- 桥接slf4j -->
<dependency>
<groupId>
org.slf4j
</groupId>
<artifactId>
jcl-over-slf4j
</artifactId>
</dependency>
<dependency>
<groupId>
org.slf4j
</groupId>
<artifactId>
log4j-over-slf4j
</artifactId>
</dependency>
<!-- 打印skywalking tid插件-->
<dependency>
<groupId>
org.apache.skywalking
</groupId>
<artifactId>
apm-toolkit-logback-1.x
</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
logger-starter/src/main/resources/logback-spring.xml
→
logger-starter/s
ecoo-log-starter/s
rc/main/resources/logback-spring.xml
View file @
34cbd1f9
...
@@ -6,23 +6,17 @@
...
@@ -6,23 +6,17 @@
<springProperty
scope=
"context"
name=
"LOG_PATH"
source=
"log.path"
defaultValue=
"/data/logs"
/>
<springProperty
scope=
"context"
name=
"LOG_PATH"
source=
"log.path"
defaultValue=
"/data/logs"
/>
<springProperty
scope=
"context"
name=
"MAX_FILE_SIZE"
source=
"log.max_file_size"
defaultValue=
"128MB"
/>
<springProperty
scope=
"context"
name=
"MAX_FILE_SIZE"
source=
"log.max_file_size"
defaultValue=
"128MB"
/>
<springProperty
scope=
"context"
name=
"MAX_HISTORY"
source=
"log.max_history"
defaultValue=
"7"
/>
<springProperty
scope=
"context"
name=
"MAX_HISTORY"
source=
"log.max_history"
defaultValue=
"7"
/>
<springProperty
scope=
"context"
name=
"PATTERN"
source=
"log.pattern"
<springProperty
scope=
"context"
name=
"PATTERN"
source=
"log.pattern"
defaultValue=
"-|%d{yyyy-MM-dd HH:mm:ss.SSS}|%-5level|%X{tid}|%thread|%logger{36}.%M:%L-%msg%n"
/>
defaultValue=
"-|%d{yyyy-MM-dd HH:mm:ss.SSS}|%-5level|%X{tid}|%thread|%logger{36}.%M:%L-%msg%n"
/>
<property
name=
"LOG_DIR"
value=
"${LOG_PATH}/${logName}/%d{yyyyMMdd}"
/>
<property
name=
"LOG_DIR"
value=
"${LOG_PATH}/${logName}/%d{yyyyMMdd}"
/>
<property
name=
"CHARSET"
value=
"UTF-8"
/>
<property
name=
"CHARSET"
value=
"UTF-8"
/>
<jmxConfigurator/>
<jmxConfigurator/>
<!-- 控制台输出 -->
<!-- 控制台输出 -->
<appender
name=
"STDOUT"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<appender
name=
"STDOUT"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<encoder
class=
"ch.qos.logback.classic.encoder.PatternLayoutEncoder"
>
<layout
class=
"ch.qos.logback.classic.PatternLayout"
>
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符 -->
<!-- <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS}|%msgno|%thread|%-5level|%logger{20}-%msg%n</pattern> -->
<pattern>
${PATTERN}
</pattern>
<pattern>
${PATTERN}
</pattern>
</encoder>
</layout>
<filter
class=
"ch.qos.logback.classic.filter.ThresholdFilter"
>
<level>
DEBUG
</level>
</filter>
</appender>
</appender>
<appender
name=
"ERROR"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<appender
name=
"ERROR"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
...
@@ -60,13 +54,6 @@
...
@@ -60,13 +54,6 @@
</layout>
</layout>
</appender>
</appender>
<appender
name=
"ASYN_STDOUT"
class=
"ch.qos.logback.classic.AsyncAppender"
>
<appender-ref
ref=
"STDOUT"
/>
<queueSize>
256
</queueSize>
<neverBlock>
true
</neverBlock>
<includeCallerData>
true
</includeCallerData>
</appender>
<appender
name=
"ASYN_APP"
class=
"ch.qos.logback.classic.AsyncAppender"
>
<appender
name=
"ASYN_APP"
class=
"ch.qos.logback.classic.AsyncAppender"
>
<appender-ref
ref=
"APP"
/>
<appender-ref
ref=
"APP"
/>
<queueSize>
1024
</queueSize>
<queueSize>
1024
</queueSize>
...
@@ -90,13 +77,8 @@
...
@@ -90,13 +77,8 @@
<!-- 日志排除 -->
<!-- 日志排除 -->
<logger
name=
"org.logicalcobwebs.proxool"
level=
"error"
/>
<logger
name=
"org.logicalcobwebs.proxool"
level=
"error"
/>
<!--统一日志输出级别,其他appender中如果有高于此处等级设置的也会被输出 -->
<!--统一日志输出级别,其他appender中如果有高于此处等级设置的也会被输出 -->
<root
level=
"${logLevel}"
>
<root
level=
"${logLevel}"
>
<springProfile
name=
"test,dev,local"
>
<appender-ref
ref=
"ASYN_STDOUT"
/>
</springProfile>
<appender-ref
ref=
"ASYN_APP"
/>
<appender-ref
ref=
"ASYN_APP"
/>
<appender-ref
ref=
"ASYN_ERROR"
/>
<appender-ref
ref=
"ASYN_ERROR"
/>
</root>
</root>
...
...
logger-starter/secoo-log/pom.xml
0 → 100644
View file @
34cbd1f9
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
logger-starter
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<version>
1.0.6-DEV-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
secoo-log
</artifactId>
<name>
${project.artifactId}
</name>
<dependencies>
<dependency>
<groupId>
org.slf4j
</groupId>
<artifactId>
slf4j-api
</artifactId>
</dependency>
<dependency>
<groupId>
ch.qos.logback
</groupId>
<artifactId>
logback-classic
</artifactId>
</dependency>
<!-- 桥接slf4j -->
<dependency>
<groupId>
org.slf4j
</groupId>
<artifactId>
jcl-over-slf4j
</artifactId>
</dependency>
<dependency>
<groupId>
org.slf4j
</groupId>
<artifactId>
log4j-over-slf4j
</artifactId>
</dependency>
<!-- 打印skywalking tid插件-->
<dependency>
<groupId>
org.apache.skywalking
</groupId>
<artifactId>
apm-toolkit-logback-1.x
</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
logger-starter/s
rc/main/resources/logback-mvc
.xml
→
logger-starter/s
ecoo-log/src/main/resources/logback
.xml
View file @
34cbd1f9
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<configuration
scan=
"true"
scanPeriod=
"60 seconds"
debug=
"false"
>
<configuration
scan=
"true"
scanPeriod=
"60 seconds"
debug=
"false"
>
<property
resource=
"log.properties"
/>
<property
resource=
"log.properties"
/>
<property
name=
"LOG_PATH"
value=
"/data/logs"
/>
<property
name=
"LOG_PATH"
value=
"/data/logs"
/>
<property
name=
"LOG_DIR"
value=
"${LOG_PATH}/${logName}/%d{yyyyMMdd}"
/>
<property
name=
"LOG_DIR"
value=
"${LOG_PATH}/${logName}/%d{yyyyMMdd}"
/>
<property
name=
"MAX_FILE_SIZE"
value=
"${logFileSize}"
/>
<property
name=
"MAX_FILE_SIZE"
value=
"${logFileSize}"
/>
<property
name=
"MAX_HISTORY"
value=
"${logMaxHistory}"
/>
<property
name=
"MAX_HISTORY"
value=
"${logMaxHistory}"
/>
...
...
rocketmq-starter/src/main/java/com/secoo/mall/mq/config/MatrixRocketMQAutoConfiguration.java
View file @
34cbd1f9
package
com
.
secoo
.
mall
.
mq
.
config
;
package
com
.
secoo
.
mall
.
mq
.
config
;
import
com.ctrip.framework.apollo.spring.boot.ApolloAutoConfiguration
;
import
com.secoo.mall.mq.hook.MatrixProducerHook
;
import
com.secoo.mall.mq.hook.MatrixProducerHook
;
import
com.secoo.mall.mq.producer.MartixProducer
;
import
com.secoo.mall.mq.producer.MartixProducer
;
import
org.apache.rocketmq.acl.common.AclClientRPCHook
;
import
org.apache.rocketmq.acl.common.AclClientRPCHook
;
...
@@ -8,7 +7,6 @@ import org.apache.rocketmq.acl.common.SessionCredentials;
...
@@ -8,7 +7,6 @@ import org.apache.rocketmq.acl.common.SessionCredentials;
import
org.apache.rocketmq.client.AccessChannel
;
import
org.apache.rocketmq.client.AccessChannel
;
import
org.apache.rocketmq.client.producer.DefaultMQProducer
;
import
org.apache.rocketmq.client.producer.DefaultMQProducer
;
import
org.apache.rocketmq.spring.autoconfigure.RocketMQProperties
;
import
org.apache.rocketmq.spring.autoconfigure.RocketMQProperties
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
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.Import
;
import
org.springframework.context.annotation.Import
;
...
@@ -22,15 +20,6 @@ import org.springframework.util.StringUtils;
...
@@ -22,15 +20,6 @@ import org.springframework.util.StringUtils;
@Import
(
MatrixListenerContainerConfiguration
.
class
)
@Import
(
MatrixListenerContainerConfiguration
.
class
)
public
class
MatrixRocketMQAutoConfiguration
{
public
class
MatrixRocketMQAutoConfiguration
{
@Bean
@ConditionalOnClass
(
ApolloAutoConfiguration
.
class
)
public
RocketMQProperties
rocketMQProperties
(){
return
new
RocketMQProperties
();
}
@Bean
@Bean
public
DefaultMQProducer
defaultMQProducer
(
RocketMQProperties
rocketMQProperties
)
{
public
DefaultMQProducer
defaultMQProducer
(
RocketMQProperties
rocketMQProperties
)
{
RocketMQProperties
.
Producer
producerConfig
=
rocketMQProperties
.
getProducer
();
RocketMQProperties
.
Producer
producerConfig
=
rocketMQProperties
.
getProducer
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment