springboot学习笔记(二)日志配置
来源:互联网 发布:手机电视下载软件 编辑:程序博客网 时间:2024/04/30 03:01
1.创建资源文件
设置日志参数:
logging.file=log.log logging.level.com.xiaofangtech.sunt.controller = debug logging.level.com.xiaofangtech.sunt.helper = warn
测试类:
/** * Test_myspringboot * Controller_test.java */package com.springboot.Test_myspringboot;import org.slf4j.Logger;import org.slf4j.LoggerFactory;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.RestController;/** * @author xuchuang * @updateTime 2017年12月20日 下午3:38:31 */@RestControllerpublic class Controller_test { private final Logger logger = LoggerFactory.getLogger(this.getClass()); @RequestMapping("/hello") String home() { logger.debug("This is a debug message"); logger.info("This is an info message"); logger.warn("This is a warn message"); logger.error("This is an error message"); return "Hello World!"; }}
启动后访问 localhost:6636/hello
查看控制台:
阅读全文
0 0
- springboot学习笔记(二)日志配置
- SpringBoot学习笔记二(常规属性配置,类型安全配置,日志配置,Profile配置)
- springboot 学习笔记(二)--- properties 配置
- springboot 学习笔记(二)--- properties 配置
- springboot学习笔记二
- Springboot学习笔记(二)
- SpringBoot学习笔记二
- springboot学习二(springboot相关配置)
- 【系统学习SpringBoot】SpringBoot配置logging日志及输出日志
- springboot(二 日志的配置)
- springboot学习笔记(二) Thymeleaf
- SpringBoot学习笔记(四) 日志系统
- SpringBoot学习笔记之日志处理
- SpringBoot学习-(二)SpringBoot注解和配置
- SpringBoot学习笔记(二) 依赖管理
- springboot 日志配置
- SpringBoot Logback日志配置
- springboot logback日志配置
- 总结 2017-12-19
- Java并发编程:CompletionService
- 【web】javascript基础巩固(五)——事件&表单
- 【C++】C++用new和不用new创建类对象区别
- iOS 开发者中的公司账号与个人账号之间有什么区别
- springboot学习笔记(二)日志配置
- Go 开发WEB服务之hello world
- android gridview 选择变色 再点击还原 并支持多选。记录贴 01
- 使用Cookie有序非重复记录已浏览商品的原理以及实现
- 安徽省阜阳市谷歌卫星地图下载(百度网盘离线包下载)
- oracle中的number类型用法及举例
- MySQL从无关联的两个或多个表中查询数据,列转行等
- Python爬取百思不得姐的视频+视频的切割
- module_param的使用