The configuration of the Struts log file log4j

Source: Internet
Author: User
Tags log4j

1: Establish log4j.properties files

2: Placement Path/web-inf/classes

3: The standard contents are as follows

------------------
### Direct log messages to stdout ###
Log4j.appender.stdout=org.apache.log4j.consoleappender
Log4j.appender.stdout.target=system.out
Log4j.appender.stdout.layout=org.apache.log4j.patternlayout
Log4j.appender.stdout.layout.conversionpattern=%d{absolute}%5p%c{1}:%l-%m%n

### Direct messages to file Hibernate.log ###
#log4j. Appender.file=org.apache.log4j.fileappender
#log4j. Appender.file.file=hibernate.log
#log4j. appender.file.layout=org.apache.log4j.patternlayout
#log4j. Appender.file.layout.conversionpattern=%d{absolute}%5p%c{1}:%l-%m%n

### set Log levels-for more verbose logging change ' info ' to ' debug ' ###

Log4j.rootlogger=warn, stdout

#log4j. Logger.org.hibernate=info
Log4j.logger.org.hibernate=debug

### Log HQL Query parser activity
#log4j. Logger.org.hibernate.hql.ast.ast=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 ###
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 Transaction activity
#log4j. Logger.org.hibernate.transaction=debug

### Log JDBC Resource acquisition
#log4j. Logger.org.hibernate.jdbc=debug

### enable the following line if your want to track down connection ###
### when using leakages Onprovider ###
#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.