1.Introduction 介绍
|
|
Welcome to Log4j 2!IntroductionAlmost every large application includes its own logging or tracing API. In conformance with this rule, the E.U. SEMPER project decided to write its own tracing API. This was in early 1996. After countless enhancements, several incarnations and much work that API has evolved to become log4j, a popular logging package for Java. The package is distributed under the Apache Software License, a fully-fledged open source license certified by the open source initiative. The latest log4j version, including full-source code, class files and documentation can be found at http://logging.apache.org/log4j/2.x/index.html.(几乎每一个大型应用程序都包含自己的日志记录或跟踪API.为了顺应这个规则,E.U. SEMPER项目决定写它自己的跟踪API。这是在1996年初。经过无数的增强, 好几个变身和大量的工作,这个API已经发展成为 log4j,一个流行的java日志记录包。这个包分发在 Apache软件许可协议下。最新的log4j的版本,包括完整的源代码,类文件和 文件,它们可以在http://logging.apache.org/log4j/2.x/index.html网站中找到。) Inserting log statements into code is a low-tech method for debugging it. It may also be the only way because debuggers are not always available or applicable. This is usually the case for multithreaded applications and distributed applications at large.(对于调试代码,将日志语句插入代码是一种低技术方法 。它也可能是唯一的方法,因为使用调试器进行调试不总是有效的和合适的。一般来说,这种情况通常发生在多线程应用程序和分布式应用程序。) Experience indicates that logging was an important component of the development cycle. It offers several advantages. It provides precise context about a run of the application. Once inserted into the code, the generation of logging output requires no human intervention. Moreover, log output can be saved in persistent medium to be studied at a later time. In addition to its use in the development cycle, a sufficiently rich logging package can also be viewed as an auditing tool.(经验表明,测试是开发周期里的一个重要组成部分。它提供了几个优点。它提供了有关应用程序运行的精确上下文。一旦将日志插入到代码中,日志输出的生成就不需要人工干预。此外,日志输出可以保存在持久性介质中进行研究,在稍后的时间。除了其在开发周期中的使用,一个足够丰富的日志包也可以被看作是一个审计工具。) As Brian W. Kernighan and Rob Pike put it in their truly excellent book "The Practice of Programming":(Brian W. Kernighan和Rob Pike把它放在他们真正的优秀书“编程实践”中:) As personal choice, we tend not to use debuggers beyond getting a stack trace or the value of a variable or two. One reason is that it is easy to get lost in details of complicated data structures and control flow; we find stepping through a program less productive than thinking harder and adding output statements and self-checking code at critical places. Clicking over statements takes longer than scanning the output of judiciously-placed displays. It takes less time to decide where to put print statements than to single-step to the critical section of code, even assuming we know where that is. More important, debugging statements stay with the program; debugging sessions are transient.(作为个人的选择,我们倾向于不使用功能强于“能够得到堆栈跟踪或变量的值”的调试器。原因之一是 复杂数据结构的细节和控制流容易丢失 ;我们发现一步一步调试,比 努力思考,增加输出语句并在关键的地方自我检查代码更加低效。打断点进行语句调试需要更长的时间来插件调试器输出的堆栈信息。思考需要在哪里打印日志,比单步调试到关键部分的代码需要更少的时间。更重要的是,调试语句和程序是保持一致; 调试信息会随着程序的运行而消失。)
Logging does have its drawbacks. It can slow down an application. If too verbose, it can cause scrolling blindness. To alleviate these concerns, log4j is designed to be reliable, fast and extensible. Since logging is rarely the main focus of an application, the log4j API strives to be simple to understand and to use.(日志记录有其缺点。它会使应用变慢。如果太冗长,它可以导致滚动失明。为了缓解这些担忧,log4j的设计是可靠的,快速的而且可扩展。由于日志几乎不会是应用程序的主要焦点, log4j API力求简单易懂,使用。) Log4j 2Log4j 1.x has been widely adopted and used in many applications. However, through the years development on it has slowed down. It has become more difficult to maintain due to its need to be compliant with very old versions of Java and became End of Life in August 2015. Its alternative, SLF4J/Logback made many needed improvements to the framework. So why bother with Log4j 2? Here are a few of the reasons.(Log4j 1。x已被广泛用于许多应用程序。然而, 经过多年的发展,它已经放缓。它变得更加 很难维护,因为它需要遵守非常旧的 java版本 并且在2015年8月它的生命终止。 他的替代品,slf4j / logback提供了许多这个框架需要改进的东西。为什么使用log4j 2?这里有几个原因。)
|
1.Introduction 介绍的更多相关文章
- 一: Introduction(介绍)
Welcome to SQLBackupRestore.com, your online resource for SQL Server backup and recovery issues. Th ...
- Security » Authorization » 介绍
Introduction¶ 介绍 77 of 87 people found this helpful Authorization refers to the process that determi ...
- rabbitmq 的心跳机制&应用
官方文档说: If a consumer dies (its channel is closed, connection is closed, or TCP connection is lost) w ...
- [原创博文] 用Python做统计分析 (Scipy.stats的文档)
[转自] 用Python做统计分析 (Scipy.stats的文档) 对scipy.stats的详细介绍: 这个文档说了以下内容,对python如何做统计分析感兴趣的人可以看看,毕竟Python的库也 ...
- Lua 架构 The Lua Architecture
转载自:http://magicpanda.net/2010/10/lua%E6%9E%B6%E6%9E%84%E6%96%87%E6%A1%A3/ Lua架构文档(翻译) 十 102010 前段时间 ...
- 【转】Application.mk 文件语法规范
原文网址:http://blog.sina.com.cn/s/blog_4c451e0e0100s6q4.html Application.mk file syntax specification A ...
- .htaccess文件的详解以及404页面的设置
打开记事本,写入以下代码: ErrorDocument 404 /404.html保存成.htaccess文件上传到网站的根目录. /404.html是目录名和文件名,可以改成自己的名字.QUOTE: ...
- SharePoint 2010中使用SPListItemCollectionPosition更快的结果
转:http://www.16kan.com/article/detail/318657.html Introduction介绍 In this article we will explore the ...
- 任何时候都适用的20个C++技巧
这些小技巧之所以特别,是因为这些信息通常吧不能在C++书籍或者网站上找到.比如说,成员指针,即使对于高级程序员也是比较棘手,和易于产生bugs的,是应该尽量避免的问题之一. <翻 by凌云健笔& ...
随机推荐
- Spring定时器的使用详解
写个最简单的demo吧,反正睡前没什么事儿,来祸害一下园子~~虽然我菜,但是我不会承认啊,哈哈哈 明天详细补充点儿吧,很晚了,不睡觉的程序员不是好程序员,我总能给自己找借口~~~ //spring开启 ...
- JAVA多线程---wait() & join()
题外话: interrupt()方法 并不能中断一个正常运行的线程!!! class myThread extends Thread{ @Override public void run(){ fo ...
- snsapi_base和snsapi_userinfo
1.以snsapi_base为scope发起的网页授权,是用来获取进入页面的用户的openid的,并且是静默授权并自动跳转到回调页的.用户感知的就是直接进入了回调页(往往是业务页面) 2.以snsap ...
- UWP 改变Button样式
-----some words------ 1.Control:控制 (我们理解成控件) 2.Template:模板 3.Ellipse 椭圆 4.Content 内容 5.Presenter 节目主 ...
- 【Learning】多项式乘法与快速傅里叶变换(FFT)
简介: FFT主要运用于快速卷积,其中一个例子就是如何将两个多项式相乘,或者高精度乘高精度的操作. 显然暴搞是$O(n^2)$的复杂度,然而FFT可以将其将为$O(n lg n)$. 这看起来十分玄学 ...
- js中 && 与 || 的妙用
在js逻辑运算中,0."".null.false.undefined.NaN都会判为false,其他都为true(好像没有遗漏了吧,请各位确认下).这个一定要记住,不然应用||和& ...
- C#解析XML详解(XPath以及带命名空间NameSpace)
<?xml version="1.0" encoding="utf-8" ?> <bookstore> <book> < ...
- 关于width与padding
http://blog.csdn.net/yaoyuan_difang/article/details/24735529
- Django自定义过滤器中is_safe和need_autoescape两个参数的理解
自定义template过滤器的方法参考文档,不再赘述 is_safe 文档说明过滤的两种最终形态,其中一种是设置register.filter(is_safe=True),但是对is_safe的具体作 ...
- 浅谈 var 关键字
提起 var关键子,程序员的第一反应就是JavaScript, 事实上这个关键子在其他语言中也有被采用. 比如说C#, 比如说kotlin, 用法和JavaScript中使用差不多,作为要声明变量的前 ...