Log4j configuration file and log configuration in the nutch
When SLF4J is used as the log system, SLF4J is only an interface and needs a specific implementation for execution.
Reference
Slf4j unifies API interfaces. Therefore, if log4j is used to output logs, you only need to set the content of the
log4j Configuration Sample
#定义根日志级别和输出端 (two outputs defined) Log4j.rootlogger=error,console,orclight #定义第一个输出端, output to console log4j.appender.console=
Org.apache.log4j.ConsoleAppender Log4j.appender.console.layout=org.apache.log4j.patternlayout log4j.appender.console.layout.conversionpattern=%d [%t]%-5p%c (%l)-%m%n #定时第二个输出端, output to a file with a maximum space of 1000KB, Automatically back up after
The simple configuration of log4j makes log4j more and more applications: the log4j configuration file provides a full set of functions such as output to the console, files, rollback files, sending log emails, output to database log tables, and custom tags.
With the emphasis on reusable component development, in addition to developing a reusable log operation class from start to end, Apache provides us with a powerful log operation package-log4j.
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 t
operation class from start to end, Apache provides us with a powerful log operation package-log4j.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 server, NT event recorder, and Unix Syslog daemon; we can also control the output format of each log. By defining the level of each log information, we can control the log
Basic information:-------------Log4j-1.2.9.jarConfiguration process:------------1) Load log4j-1.2.9.jar2) Configure log4j. properties in the root path. refer to the following log4j configuration code.3) Add the following logging code to the Java file, JSP, or servlet for log
Document directory
I. Three Components of log4j
Ii. Configuration File
In fact, the use of logs is very simple. 1. Import the log4j package, 2. Define the configuration file, and 3. Use it. General steps: Define the log object → read the configuration file → output to
When Tomcat runs for only one day, the disk space Suddenly increases a lot. if it finds that the log file is too large, modify the log configuration of Tomcat.
View the space occupied by the directory:
[[emailprotected]webapps]du-sh
Cleaning Method:
[[emailprotected]logs]#cat>catalina.out
It is best to use log4 logs. The following describes how to configure Tomcat and log4.
1. Download The tomcat-juli.jar and tomcat-juli-adapters.jar cor
First, create a new log4j. properties file in the project classes; In actual programming, you must define the configuration file before making log4j really run in the system. The definition step is to use logger, appender, and layout respectively. Log4j supports two configuration
Log4j log Configuration
1. Configure the root logger:
Log4j. rootlogger = [level], appendername, appendername2
Level: the log level, which specifies the importance of the log information. It can be divided into four types: All
Debug (Object message );
Info (Object message );
Warn (Object message );
Error (Object message );
If the set level is info, logs with a
The parameter configuration in the log4j configuration file is mainly divided into three parts: Priority configuration, log information output destination configuration, and log information output format configuration.
The log pri
Log4j is an open-source log component developed by Apache. log4j can control the delivery of log information to the console, files, and GUI components, and control the output format of each log; the configuration file can be used for flexible configuration to control the log generation process in greater detail. The fo
From: http://dingjun1.javaeye.com/blog/413993
Reprinted:
Http://wangjc-opal.javaeye.com/blog/309924
There is no doubt about the powerful functions of log4j, but in actual applications, it is inevitable that an independent log file needs to be output for a function. How can we separate the required content from the original log, what about creating a separate log file? In fact, you can easily implement this function with a slight
Log4j introduction:
Log4j is a powerful logging tool that records operation information in the system and helps administrators analyze and manage related data in the background. You can record the data console, files, interface servers, and GUI components. You can configure or flexibly record the log format through your own configuration to achieve data analysis
The log4j. properties configuration file is described as follows:
# Set root logger level to debug and its only appender to A1
# Log4j has five levels of logger
# Fatal 0
# Error 3
# Warn 4
# INFO 6
# Debug 7
Configure the root logger with the Syntax:
# Log4j. rootlogger = [level], appendername, appendername ,...
The log4j. properties configuration file is described as follows:
# Set root logger level to debug and its only appender to A1
# Log4j has five levels of logger
# Fatal 0
# Error 3
# Warn 4
# INFO 6
# Debug 7
Configure the root Logger with the Syntax:
# Log4j. rootlogger = [level], appendername, appendername ,...
The log4j configuration file (Configuration file) is used to set the level, the repository, and the layout of the logger, and it can be set in key=value format or in XML format information. By configuring, you can create a log4j running environment. The log4j
Log4j external configuration file.
Log4j details:
1. Define the configuration fileLog4j supports two configuration file formats: XML and Java. log4j. properties (Key = value ).
I will give two written files (
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.