- 浏览: 804231 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (360)
- Java (101)
- JPA/Hibernate (10)
- Spring (14)
- Flex/BlazeDS (37)
- Database (30)
- Lucene/Solr/Nutch (0)
- Maven/Ant (25)
- CXF/WebService (3)
- RPC/RMI/SOAP/WSDL (1)
- REST (6)
- TDD/BDD/JUnit (1)
- Servlet/JSP (2)
- AI/MachineLearning (3)
- Resource (1)
- 字符编码 (2)
- OOA/OOPS/UML (5)
- DesignPattern (8)
- 算法与数据结构 (11)
- Web&App Server (13)
- 并发&异步&无阻塞 (7)
- Entertainment (4)
- JavaScript/ExtJS (45)
- CodeStyle&Quality (1)
- svn/git/perforce (8)
- JSON (2)
- JavaScriptTesting (4)
- Others (6)
- RegularExpression (2)
- Linux/Windows (12)
- Protocal (2)
- Celebrities (1)
- Interview (1)
- 计算机语言 (1)
- English (2)
- Eclipse (5)
- TimeZone/时区 (1)
- Finance (1)
- 信息安全 (1)
- JMS/MQ (2)
- XSD/XML/DTD (3)
- Android (4)
- 投资 (3)
- Distribution (3)
- Excel (1)
最新评论
-
qdujunjie:
如果把m换成具体的数字,比如4或者5,会让读者更明白
m阶B树中“阶”的含义 -
java-admin:
不错,加油,多写点文章
关于Extjs的mixins和plugin -
xiehuaidong880827:
你好,我用sencha cmd打包完本地工程后,把app.js ...
ExtJS使用Sencha Cmd合并javascript文件为一个文件 -
KIWIFLY:
lwpan 写道inverse = "true&qu ...
Hibernate中什么时候使用inverse=true -
luedipiaofeng:
good
消除IE stop running this script弹出框
参考文档:http://logback.qos.ch/manual/configuration.html
对于maven项目,将测试用的配置文件logback-test.xml放在test/resources/下即可.
Logback can be configured either programmatically or with a configuration script expressed in XML or Groovy format. By the way, existing log4j users can convert their log4j.properties files to logback.xml using our PropertiesTranslator web-application.
logback按如下顺序寻找配置文件,
Let us begin by discussing the initialization steps that logback follows to try to configure itself:
1) Logback tries to find a file called logback.groovy in the classpath.
2)If no such file is found, logback tries to find a file called logback-test.xml in the classpath.
3)If no such file is found, it checks for the file logback.xml in the classpath..
4)If neither file is found, logback configures itself automatically using the BasicConfigurator which will cause logging output to be directed to the console.
The fourth and last step is meant to provide a default (but very basic) logging functionality in the absence of a configuration file.
If you are using Maven and if you place the logback-test.xml under the src/test/resources folder, Maven will ensure that it won't be included in the artifact produced. Thus, you can use a different configuration file, namely logback-test.xml during testing, and another file, namely, logback.xml, in production. The same principle applies by analogy for Ant.
配置文件模板:
对于maven项目,将测试用的配置文件logback-test.xml放在test/resources/下即可.
Logback can be configured either programmatically or with a configuration script expressed in XML or Groovy format. By the way, existing log4j users can convert their log4j.properties files to logback.xml using our PropertiesTranslator web-application.
logback按如下顺序寻找配置文件,
Let us begin by discussing the initialization steps that logback follows to try to configure itself:
1) Logback tries to find a file called logback.groovy in the classpath.
2)If no such file is found, logback tries to find a file called logback-test.xml in the classpath.
3)If no such file is found, it checks for the file logback.xml in the classpath..
4)If neither file is found, logback configures itself automatically using the BasicConfigurator which will cause logging output to be directed to the console.
The fourth and last step is meant to provide a default (but very basic) logging functionality in the absence of a configuration file.
If you are using Maven and if you place the logback-test.xml under the src/test/resources folder, Maven will ensure that it won't be included in the artifact produced. Thus, you can use a different configuration file, namely logback-test.xml during testing, and another file, namely, logback.xml, in production. The same principle applies by analogy for Ant.
配置文件模板:
<configuration> <appender name="FILE" class="ch.qos.logback.core.FileAppender"> <file>myApp.log</file> <encoder> <pattern>%date %level [%thread] %logger{10} [%file:%line] %msg%n</pattern> </encoder> </appender> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <pattern>%msg%n</pattern> </encoder> </appender> <logger name="org.hibernate"> <appender-ref ref="STDOUT" /> </logger> <logger name="com.test"> <appender-ref ref="FILE" /> </logger> <root level="debug"> <appender-ref ref="FILE" /> <appender-ref ref="STDOUT" /> </root> </configuration>
发表评论
-
sapjco3 notes
2019-03-21 14:51 1163sapjco https://support.sap.com/ ... -
使用RestTemplate发送post JSON请求
2019-01-12 17:30 4741private final String BASE_URL = ... -
使用RestTemplate发送post JSON请求
2019-01-12 17:30 3506private final String BASE_URL = ... -
Spring线程池ThreadPoolTaskExecutor
2018-08-06 09:51 1886<!-- spring thread pool ex ... -
Spring注解事物@Transactional不工作
2018-08-02 18:50 2676“In proxy mode (which is the de ... -
创建前缀索引报长度超出错误
2018-07-25 15:44 1731表结构定义如下: CREATE TABLE `sku` ( ` ... -
Mysql Varchar字符长度
2018-07-25 15:23 1352`sku_name` VARCHAR(200) NOT NUL ... -
使用 Spring RestTemplate 发送 post 请求
2018-07-23 18:49 11727注意点: 1)使用MultiValueMap设置入参,不要使 ... -
Java动态代理Dynamic Proxy
2018-07-21 16:33 813JAVA学习篇--静态代理VS动态代理 https://blo ... -
分布式实时日志分析解决方案 ELK 部署架构
2018-07-20 09:52 1189原文链接:http://www.importn ... -
为什么HashMap容量一定要为2的幂呢?
2018-07-19 10:07 1728原文链接:https://blog.csdn.net/wang ... -
为什么计算HashCode时通常选择31这个数?
2018-07-19 10:05 1420摘自http://www.importnew.com/2208 ... -
jackson自定义序列化和反序列化
2018-07-10 18:47 2241原文链接:https://blog.csdn.net/liu ... -
Pay special attention when modifying online running system
2017-06-23 10:25 0Never remove any properties, me ... -
Map中的Null key, Null Value
2017-06-14 10:52 1946ConcurrentHashMap的key和value都不能为 ... -
Java语法糖
2017-06-05 20:03 530Java语法糖之foreach http://www.imp ... -
Java集合相关
2017-05-24 17:55 0Java集合框架:ArrayList http://www. ... -
Java数据类型的转换:隐式(自动)转换与强制转换
2017-05-14 10:46 0http://blog.csdn.net/u011240877 ... -
分布式开放消息系统(RocketMQ)的原理与实践
2017-05-07 19:55 730分布式开放消息系统(RocketMQ)的原理与实践 http ... -
面试知识点复习(Interview knowledge review)
2017-05-07 18:39 0JVM,多线程相关知识 http://darrenzhu.it ...
相关推荐
LogBack配置文件,主要包括LOGBack的配置文件内容
springboot整合logback配置文件
项目中在使用的logback,拿过去直接可以用,带完整的中文说明。
logback学习使用的配置文件,logback入门使用配置
`logback.xml` 配置文件是 Logback 框架的核心部分,用于定制日志行为。它允许你定义日志级别(如 TRACE, DEBUG, INFO, WARN, ERROR, FATAL 和 OFF),指定日志输出目的地(控制台、文件、数据库等),以及配置过滤...
该文件包含logback配置文件示例和配置文件内容解析,如果想深入学习的系哦小伙伴可以下载看看,如果只是想实现功能,可以查看我的博客 《整合篇------JAVA项目整合Logback》
logback 的默认配置如果配置文件 logback-test.xml 和 logback.xml 都不存在,那么 logback 默认地会调用 BasicConfigurator,创建一个最小化配置。最小化配置由一个关联到根 logger 的 ConsoleAppender 组成。输出...
logback配置文件demo,用于在springboot项目中放到resource 目录下即可 logback配置文件demo,用于在springboot项目中放到resource 目录下即可
"logback-slf4j日志配置文件下载即可使用" logback-slf4j是Java领域中一种常用的日志记录解决方案,它通过结合slf4j(Simple Logging Facade for Java)来提供了异步日志输出的功能,能够将日志输出到不同的文件中...
logback配置文件放入resource
在这里,我们关注的是SLF4J的API库`slf4j-api-1.7.26.jar`,以及Logback的两个核心组件`logback-core-1.2.3.jar`和`logback-classic-1.2.3.jar`,以及配置文件`logback.xml`。 首先,`slf4j-api-1.7.26.jar`是SLF4J...
《Logback配置文件根据LEVEL级别将日志分类保存到不同文件》 日志管理是软件开发中的重要一环,它能帮助开发者追踪程序运行状态,定位问题,优化性能。Logback是一个广泛使用的日志框架,它允许我们高效地处理日志...
springboot-logback日志文件配置
Logback配置文件 Logback的配置主要通过`logback.xml`文件完成,这是一个XML格式的配置文件,用于定义日志级别、日志输出目的地、过滤器等。以下是一份基本的`logback.xml`配置示例: ```xml ...
在“SpringBoot+tk.Mybatis整合+yml配置+logback配置”这个主题中,我们将探讨以下几个关键知识点: 1. **SpringBoot整合tk.Mybatis**: tk.Mybatis 是 Mybatis 的一个扩展,提供了很多实用功能,如:动态 SQL、...