log4j Introduction
LOG4J is an Apache open source project, through the use of log4j, we can control the log information delivery destination is the console, files, GUI components, even the 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.
Second, the configuration file
View Code
Third, the use of the program
View Code
Four, log4j more comprehensive configuration
The simplicity of the log4j configuration makes it pervasive in a growing number of applications:
The log4j configuration file implements a full set of functions such as output to console, file, rollback file, send log mail, output to database log table, custom label, etc. The one or two use is enough.
View Code
log4j summary [Go]