Key Words: Log copy Log4j-1.2.9.jar to/web-inf/lib directory
It's no use adding Log4j-1.2.9.jar references in Eclipse's Java builder path
Under the copy Log4j-1.2.9.jar to/web-inf/lib
TomcatYou need to automatically find the lib below this directory at startup, and the Eclipse reference is used in development use and, in the absence of a release,
TomcatThes
To be perfected:(1). Here is an introduction to log4j more detailed blog, a cursory look at the next time to look deeper, write a more in-depth introduction, the first link recorded here:Log4j Detailed IntroductionThe log about log4j has been confused. Here is a summary summary:(2) log4j has a lot of bugs, such as deadlock. Now there are logback and log4j2. I'll
When the project is on-line, the runtime often also has an exception, in the exception throws, want to get feedback immediately. So you need to configure the log4j send email function.The original version of log4j used in the project is 1.2.9, but this version does not support the authentication function of the mail service, so the latest version 1.2.14 is downloaded again to view the source codeThis versio
Reprint, original website: http://blog.csdn.net/wud_jiyanhui/article/details/6213443The concept and function of system logAs an application service, the log system plays an important role in tracking debugging, program state record, and recovery of crash data .Common Java Log SystemLog4jOne of the earliest Java log frameworks, launched by the Apache Foundation, provides a flexible and powerful logging mechanism.JDK1.4 LoggingframeworkFollowing log4j
1.1 Preparation work
One, Tomcat has been properly configured and used.
Second, software download: log4j------Http://www.apache.org/dist/jakarta/log4j/jakarta-log4j-1.2.8.zip
1.2. log4j Introduction
In emphasizing reusable component development today, in addition to developing a reusable log operation class from be
LOG4J Component Composition
The log4j is composed of three important components:
1. Priority of log information (Logger)
2. Output Destination of log information (Appender)
3. The output format of the log information (Layout).
Profile:
The priority of log information from high to low has error, WARN, INFO, DEBUG, respectively, to specify the importance of this log information;
The output destination
1. Basic Configuration
# The simplicity of log4j configuration makes it more and more widely used # The log4j configuration file outputs to the console, files, rollback files, send log emails, and output to the database log tables, custom tags, and other functions. # Generally, log files or databases are usually output. In this example, output files are used. # we recommend that you use only four levels of
1 Overview
This document is a guide to using the LOG4J logging tool. Includes: Log introduction, logging tool Introduction, LOG4J basic usage, advanced use of log4j, integration of spring and log4j, etc. And an example is illustrated.
This document is intended for all Java developers. 2nd Blog Introduction
A file th
The log4j configuration file is described in the preceding article, and today describes how to use log4j in a common Javaweb project.In the daily development process, the log is used very frequently, we can use the log to track the program errors, program runtime output parameters, etc., in many cases may use SYSTEM.OUT.PRINTLN () This method, but there is a more concise way, that is, using the log framewor
Write in front
In project development, logging error logs has the following benefits:
Easy Commissioning
Easy to find errors during system operation
Store business data for post-analysis purposes
In Java, there are many ways to log logs:
Own implementation
Write your own class, log data to IO operation, write data to a text file, a database.
Using log4j
LOG4J
Use of 30-40530-log4j
1. Add the log4j-1.2.16.jar package to buildpath and copy the log4j. properties file to the class path.
The content of the log4j. properties attribute file.
#--------------------------------#Log4j. rootLogger = INFO, stdout#
Log4j and log (1) Common log4j configuration common log4j configuration, generally two methods can be used ,. properties and. xml. Here are two simple examples: 1. log4j. properties ### set org. level INFO, DEBUG, WARN, ERROR, and output location A1, A2 # log4j.category.org. zblog = ERROR, A1 log4j.category.org. zblog
Transferred from: http://blog.csdn.net/kobejayandy/article/details/17335407If for commons-loging, log4j, slf4j, Logback, etc. are already very clear, you can ignore this article. A few times to solve the log conflict problem when the simple summary of these concepts, I hope that the foundation does not understand the students can help, of course, if this piece has a deeper understanding of the students, but also contribute their knowledge and insight.
the relationship between slf4j log4j Logback
What is the simple Logging façade for Java.
Generally speaking is slf4j is a series of log interface, and log4j Logback is the specific implementation of the log framework. Next, we'll look at their relationship in detail in the official document.
The simple Logging façade for Java (SLF4J) serves as a simple façade or abstraction for various Logging framework
Common-loggingcommon-logging is a common log interface provided by Apache. The user is free to choose the third party's log component as a concrete implementation, like log4j, or the logging that comes with the JDK, common-logging will automatically find the log library that is actually used when the program runs by dynamic lookup mechanism. Of course, there is a simple logger implementation of common-logging inside, but the function is very weak. So
First, IntroductionLOG4J is an Apache open source project, by using log4j, we can control the destination of log information delivery is console, file, GUI component, even socket server , NT Event recorder, UNIX syslog daemon, etc. We can also control the output format of each log, and by defining the level of each log information, we can control the log generation process more carefully. Log4j consists of
1. log4j
IntroductionLog4j is an open-source project of Apache. It allows developers to output log information at any interval. Log4j consists of three main types of components: 1) logger-is responsible for outputting log information and classifying and filtering log information to determine which logs should be output and which should be ignored. The loggers component outputs log information at five levels
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.