Log4j. perproties Configuration

Source: Internet
Author: User
# -- Log4j. rootlogger: output the log information with the info level to the stdout and file destinations. The definitions of stdout and file can be named in the following code. Levels can be divided into off, fatal, error, warn, info, debug, and all. If off is configured, no information is displayed. If Info is configured, only info, warn is displayed, error Log information, while debug information is not displayed
Log4j. rootlogger = warn, stdout, file
#################################


# -- Log4j. appender. stdout
### -- Org. Apache. log4j. leleappender (console)
### -- Org. Apache. log4j. fileappender (file)
### -- Org. Apache. log4j. dailyrollingfileappender (a log file is generated every day)
### -- Org. Apache. log4j. rollingfileappender (a new file is generated when the file size reaches the specified size)
### -- Org. Apache. log4j. writerappender (send log information to any specified place in stream format)
Log4j. appender. stdout = org. Apache. log4j. leleappender
#################################


# Log4j. appender. stdout. Target = system. Out


# -- Log4j. appender. stdout. layout defines the type of layout at the output end of stdout.
### -- Org. Apache. log4j. htmllayout (layout in HTML form)
### -- Org. Apache. log4j. patternlayout (you can flexibly specify the layout mode)
### -- Org. Apache. log4j. simplelayout (including the log information level and information string)
### -- Org. Apache. log4j. ttcclayout (including the log generation time, thread, category, and other information)
Log4j. appender. stdout. layout = org. Apache. log4j. patternlayout
#################################


# -- Log4j. appender. stdout. layout. conversionpattern: if the pattern layout is used, the specific format of the print information must be specified. conversionpattern
### -- % M output the specified message in the code
### -- % P output priority, that is, debug, info, warn, error, fatal
### -- % R the number of milliseconds it takes to output the log information from application startup to output
### -- % C output category, usually the full name of the class
### -- % T name of the thread that outputs the log event
### -- % N output a carriage return line break. For Windows, the return value is "RN", and for UNIX, the return value is "N"
### -- % D date or time of the log output time point. The default format is iso8601. You can also specify the format after it, for example, % d {yyyy Mmm dd hh: mm: SS, SSS}, output: October 18, 2002 22:10:28, 921
### -- % L location where the log event is output, equivalent to % C. % m (% F: % L) combination, including the category name, the thread that occurs, and the number of lines in the code.
### -- % F name of the file where the log message is generated
### -- % L the row number in the output code
### -- % 5 p add 5 spaces before Priority
### -- [XXX] The content in brackets is used for display. It can be any character and is generally called the project abbreviation.
Log4j. appender. stdout. layout. conversionpattern = % d {yyyy-mm-dd hh: mm: SS} % 5 p (% F: % L)-% m % N
#################################
# % D {yyyy-mm-dd hh: mm: SS} % 5 p (% F: % L)-% m % N
# % D {absolute} % 5 P % c {1}: % L-% m % N
# [Cxx] % d {yyyy-mm-dd hh: mm: SS} % 5 p (% F: % L)-% m % N


Log4j. appender. File = org. Apache. log4j. rollingfileappender
Log4j. appender. file. File = cxxhibernate. Log
Log4j. appender. file. layout = org. Apache. log4j. patternlayout
Log4j. appender. file. layout. conversionpattern = % d {yyyy-mm-dd hh: mm: SS} % 5 p (% F: % L)-% m % N
# Set the maximum log file capacity to KB
Log4j. appender. file. maxfilesize = 1000kb
# Set the maximum number of log files
Log4j. appender. file. maxbackupindex = 10
#################################


# -- Print Info-level logs in the Java class under the org. hibernate package
# Log4j.logger.org. hibernate = info
# Log4j.logger.org. hibernate. EJB = debug
# Log4j.logger.org. hibernate. Reflection = debug


# Log4j.logger.org. hibernate. Engine. Cascades = debug
# Log4j.logger.org. hibernate. hql = debug


### Log just the SQL
# Log4j.logger.org. hibernate. SQL = debug


### Log JDBC bind parameters ###
# Log4j.logger.org. hibernate. type = info
# Log4j.logger.org. hibernate. type = debug


### Log schema export/update print Org. hibernate. tool. debug-level logs in the Java class under the hbm2ddl package are automatically created using the HBM configuration file or annotation DDL (Database Definition Language) Statement ###
Log4j.logger.org. hibernate. tool. hbm2ddl = debug


### Log hql parse trees
# Log4j.logger.org. hibernate. hql = debug


### Log cache activity ###
# Log4j.logger.org. hibernate. cache = debug


### Log JDBC Resource Acquisition
# Log4j.logger.org. hibernate. JDBC = debug


### Enable the following line if you want to track down connection ###
### Leakages when using drivermanagerconnectionprovider ###
# Log4j.logger.org. hibernate. Connection. drivermanagerconnectionprovider = trace

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.