Label: log4j
I. Introduction Log4j is an open-source project of Apache. By using log4j, we can control the log information delivery destination, including the console, files, Gui components, and even the interface service set, NT event recorder, and Unix Syslog daemon; we can also control the output format of each log. By defining the level of each log informa
Configuration log file relative path in http://sharep.blog.51cto.com/539048/143734 log4j
2009-03-30 18:52:55 Tags: log4j leisure career
This article is written more comprehensive, turn around, is to share it, at the same time thank Javaeye on the Zengjinliang, OH method One, the solution is to use the relative path to replace the absolute path, in fact, log4j Fil
Mysql TIMESTAMP Usage Details, mysqltimestamp
1. TIMESTAMP variants
TIMESTAMP timestamps can have multiple different features during creation, such:
1. Refresh the data column when creating a new record or modifying an existing record:
TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
2. Set this field to
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
Reprint Please specify source: http://blog.csdn.net/qq_26525215This article is from the "university trip _ Remember the blog"
log4j IntroductionLog4j, the specific I will not copy the introduction of the official website, as long as we know that this is to help us record the log on it.The role of these 2:1, tracking the running track code.2. Output Debugging informationIt's simple, but it's a really useful tool! Do not need to be very deep to und
One, why use commons-logging+log4j? Commons-logging and log4j are open source projects under Apache. The purpose of commons-logging is to provide a unified interface for "All Java log implementations" that decouple the project from the Log Implementation tool, its own log function is weak (only a simple simplelog), so it is generally not used alone. The log4j fea
Log4j is the de facto Java standard logging tool. Is it possible to use log4j to a certain extent, it is a standard to measure whether a developer is a qualified Java programmer. If you're a Java programmer, if you're not using log4j, then you really need to read this article. Many friends reflect want to write the program log, but do not know how to write the lo
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.
Log4j supports two configuration file formats: XML and Java. log4j. properties (Key = value ).
Log4j is an open source project and is a widely used logging package written in Java. Due to the outstanding performance of log4j, at the time when log4j was completed, the
Method 1:
Create a log4j. properties file in the src directory of the project, which is automatically copied to/WEB-INF/classes with the following content:
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->
### Set log levels ###Log4j. rootlogger
=
Debug
,
Stdout
,
D
,
E ### Output to the console ###Log
MysqlTIMESTAMP (timestamp) details bitsCN.com
TIMESTAMP variant1. timestamp default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP refresh this data column when creating a new record and modifying an existing record2, timestamp default CURRENT_TIMESTAMP when creating a new record, set this field to the current time, but
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.