Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
程序员大阳
spring-boot-wikis
提交
1fc96b2e
S
spring-boot-wikis
项目概览
程序员大阳
/
spring-boot-wikis
通知
71
Star
1
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
spring-boot-wikis
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
1fc96b2e
编写于
5月 08, 2020
作者:
S
studyingpanda
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chen
上级
45175e34
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
39 addition
and
13 deletion
+39
-13
spring-boot-log/pom.xml
spring-boot-log/pom.xml
+7
-0
spring-boot-log/src/main/resources/application.properties
spring-boot-log/src/main/resources/application.properties
+7
-0
spring-boot-log/src/test/java/com/imooc/springbootlog/LogTest.java
...ot-log/src/test/java/com/imooc/springbootlog/LogTest.java
+25
-0
spring-boot-log/src/test/java/com/imooc/springbootlog/SpringBootLogApplicationTests.java
...om/imooc/springbootlog/SpringBootLogApplicationTests.java
+0
-13
未找到文件。
spring-boot-log/pom.xml
浏览文件 @
1fc96b2e
...
...
@@ -24,6 +24,13 @@
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter
</artifactId>
</dependency>
<!-- lombok -->
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
<version>
1.18.12
</version>
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
...
...
spring-boot-log/src/main/resources/application.properties
浏览文件 @
1fc96b2e
# 设置日志级别
logging.level.root
=
WARN
# 设置日志文件
logging.file
=
C:
\\
logs
\\
spring-boot-log.log
# 设置日志目录
logging.path
=
C:
\\
logs
spring-boot-log/src/test/java/com/imooc/springbootlog/LogTest.java
0 → 100644
浏览文件 @
1fc96b2e
package
com.imooc.springbootlog
;
import
org.junit.jupiter.api.Test
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
lombok.extern.slf4j.Slf4j
;
@SpringBootTest
@Slf4j
// 添加日志输出注解
class
LogTest
{
// 不再需要定义 logger
// private Logger logger = LoggerFactory.getLogger(this.getClass());
@Test
void
testPrintLog
()
{
// 直接使用log输出日志
log
.
trace
(
"trace log"
);
log
.
debug
(
"debug log"
);
log
.
info
(
"info log"
);
log
.
warn
(
"warn log"
);
log
.
error
(
"error log"
);
}
}
\ No newline at end of file
spring-boot-log/src/test/java/com/imooc/springbootlog/SpringBootLogApplicationTests.java
已删除
100644 → 0
浏览文件 @
45175e34
package
com.imooc.springbootlog
;
import
org.junit.jupiter.api.Test
;
import
org.springframework.boot.test.context.SpringBootTest
;
@SpringBootTest
class
SpringBootLogApplicationTests
{
@Test
void
contextLoads
()
{
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录