Config log4j for spring in wsad

Source: Internet
Author: User

In springframework, for logging by log4j subsystem, We Can config it with the file named log4j. properties and put it in the folder web-INF/class /(If using wsad, you should put it in your ource/. It will be deployed to Web-INF/class.).
The content of a log4j. properties file like this:


Log4j. rootcategory = info, stdout, logfile
Log4j. appender. stdout = org. Apache. log4j. leleappender
Log4j. appender. stdout. layout = org. Apache. log4j. patternlayout
Log4j. appender. stdout. layout. conversionpattern = % d % P [% C]-<% m> % N

Log4j. appender. logfile = org. Apache. log4j. rollingfileappender
Log4j. appender. logfile. File =/home/trisberg/jakarta-tomcat-4.1.24/logs/springapp. Log
Log4j. appender. logfile. maxfilesize = 512kb
# Keep three backup files
Log4j. appender. logfile. maxbackupindex = 3
Log4j. appender. logfile. layout = org. Apache. log4j. patternlayout
# Pattern to output: date priority [category]-<message> line_separator
Log4j. appender. logfile. layout. conversionpattern = % d % P [% C]-<% m> % N

The item "log4j. appender. logfile. File" is the path.

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.