Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
武汉红喜
whatsmars
提交
ce51f434
W
whatsmars
项目概览
武汉红喜
/
whatsmars
通知
3
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
W
whatsmars
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
ce51f434
编写于
1月 10, 2018
作者:
武汉红喜
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
logback-spring.xml
上级
923376c0
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
101 addition
and
8 deletion
+101
-8
whatsmars-spring-boot-samples/pom.xml
whatsmars-spring-boot-samples/pom.xml
+10
-0
whatsmars-spring-boot-samples/whatsmars-boot-sample-aop/pom.xml
...ars-spring-boot-samples/whatsmars-boot-sample-aop/pom.xml
+0
-7
whatsmars-spring-boot-samples/whatsmars-boot-sample-logback/pom.xml
...spring-boot-samples/whatsmars-boot-sample-logback/pom.xml
+23
-0
whatsmars-spring-boot-samples/whatsmars-boot-sample-logback/src/main/java/org/hongxi/whatsmars/boot/sample/logback/SampleLogbackApplication.java
...atsmars/boot/sample/logback/SampleLogbackApplication.java
+27
-0
whatsmars-spring-boot-samples/whatsmars-boot-sample-logback/src/main/resources/application.yml
...rs-boot-sample-logback/src/main/resources/application.yml
+1
-0
whatsmars-spring-boot-samples/whatsmars-boot-sample-logback/src/main/resources/logback-spring.xml
...boot-sample-logback/src/main/resources/logback-spring.xml
+8
-0
whatsmars-spring-boot-samples/whatsmars-boot-sample-logback/src/test/java/org/hongxi/whatsmars/boot/sample/logback/SampleLogbackApplicationTests.java
...rs/boot/sample/logback/SampleLogbackApplicationTests.java
+31
-0
whatsmars-spring-cloud/whatsmars-cloud-zuul/src/main/resources/logback.xml
...cloud/whatsmars-cloud-zuul/src/main/resources/logback.xml
+1
-1
未找到文件。
whatsmars-spring-boot-samples/pom.xml
浏览文件 @
ce51f434
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
<modules>
<modules>
<module>
whatsmars-boot-sample-aop
</module>
<module>
whatsmars-boot-sample-aop
</module>
<module>
whatsmars-boot-sample-session
</module>
<module>
whatsmars-boot-sample-session
</module>
<module>
whatsmars-boot-sample-logback
</module>
</modules>
</modules>
<!--<properties>
<!--<properties>
...
@@ -34,6 +35,15 @@
...
@@ -34,6 +35,15 @@
</dependencies>
</dependencies>
</dependencyManagement>
</dependencyManagement>
<dependencies>
<!-- Test -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
</dependencies>
<build>
<build>
<plugins>
<plugins>
<plugin>
<plugin>
...
...
whatsmars-spring-boot-samples/whatsmars-boot-sample-aop/pom.xml
浏览文件 @
ce51f434
...
@@ -13,17 +13,10 @@
...
@@ -13,17 +13,10 @@
<name>
${project.artifactId}
</name>
<name>
${project.artifactId}
</name>
<dependencies>
<dependencies>
<!-- Compile -->
<dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-aop
</artifactId>
<artifactId>
spring-boot-starter-aop
</artifactId>
</dependency>
</dependency>
<!-- Test -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
</dependencies>
</dependencies>
...
...
whatsmars-spring-boot-samples/whatsmars-boot-sample-logback/pom.xml
0 → 100644
浏览文件 @
ce51f434
<?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>
whatsmars-spring-boot-samples
</artifactId>
<groupId>
org.hongxi
</groupId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
whatsmars-boot-sample-logback
</artifactId>
<name>
${project.artifactId}
</name>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter
</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
whatsmars-spring-boot-samples/whatsmars-boot-sample-logback/src/main/java/org/hongxi/whatsmars/boot/sample/logback/SampleLogbackApplication.java
0 → 100644
浏览文件 @
ce51f434
package
org.hongxi.whatsmars.boot.sample.logback
;
import
javax.annotation.PostConstruct
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
@SpringBootApplication
public
class
SampleLogbackApplication
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
SampleLogbackApplication
.
class
);
@PostConstruct
public
void
logSomething
()
{
logger
.
debug
(
"Sample Debug Message"
);
logger
.
trace
(
"Sample Trace Message"
);
}
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
SampleLogbackApplication
.
class
,
args
).
close
();
}
}
\ No newline at end of file
whatsmars-spring-boot-samples/whatsmars-boot-sample-logback/src/main/resources/application.yml
0 → 100644
浏览文件 @
ce51f434
#spring.profiles.active: staging
\ No newline at end of file
whatsmars-spring-boot-samples/whatsmars-boot-sample-logback/src/main/resources/logback-spring.xml
0 → 100644
浏览文件 @
ce51f434
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include
resource=
"org/springframework/boot/logging/logback/base.xml"
/>
<logger
name=
"sample.logback"
level=
"DEBUG"
/>
<springProfile
name=
"staging"
>
<logger
name=
"sample.logback"
level=
"TRACE"
/>
</springProfile>
</configuration>
\ No newline at end of file
whatsmars-spring-boot-samples/whatsmars-boot-sample-logback/src/test/java/org/hongxi/whatsmars/boot/sample/logback/SampleLogbackApplicationTests.java
0 → 100644
浏览文件 @
ce51f434
package
org.hongxi.whatsmars.boot.sample.logback
;
import
org.junit.Rule
;
import
org.junit.Test
;
import
org.springframework.boot.test.rule.OutputCapture
;
import
static
org
.
hamcrest
.
Matchers
.
containsString
;
import
static
org
.
hamcrest
.
Matchers
.
not
;
public
class
SampleLogbackApplicationTests
{
@Rule
public
OutputCapture
outputCapture
=
new
OutputCapture
();
@Test
public
void
testLoadedCustomLogbackConfig
()
throws
Exception
{
SampleLogbackApplication
.
main
(
new
String
[
0
]);
this
.
outputCapture
.
expect
(
containsString
(
"Sample Debug Message"
));
this
.
outputCapture
.
expect
(
not
(
containsString
(
"Sample Trace Message"
)));
}
@Test
public
void
testProfile
()
throws
Exception
{
SampleLogbackApplication
.
main
(
new
String
[]
{
"--spring.profiles.active=staging"
});
this
.
outputCapture
.
expect
(
containsString
(
"Sample Debug Message"
));
this
.
outputCapture
.
expect
(
containsString
(
"Sample Trace Message"
));
}
}
\ No newline at end of file
whatsmars-spring-cloud/whatsmars-cloud-zuul/src/main/resources/logback.xml
浏览文件 @
ce51f434
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<configuration>
<property
name=
"log.context.name"
value=
"whatsmars-
sharding-jdbc
"
/>
<property
name=
"log.context.name"
value=
"whatsmars-
cloud-zuul
"
/>
<property
name=
"log.charset"
value=
"UTF-8"
/>
<property
name=
"log.charset"
value=
"UTF-8"
/>
<property
name=
"log.pattern"
value=
"[%-5level] %date --%thread-- [%logger] %msg %n"
/>
<property
name=
"log.pattern"
value=
"[%-5level] %date --%thread-- [%logger] %msg %n"
/>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录