log4j configuration, debug output and output log files for specified packages to Tomcat logs directory

Source: Internet
Author: User
Tags log4j
# Output pattern: date [Thread] Log priority directory-message
log4j.rootlogger=info, Console, Rollingfile
# only for programs under Com.mypackage.deng Day Log priority DEBUG output, other packages follow global log level info
log4j.logger.com.mypackage.deng=debug
#Console
log4j.appender.console= Org.apache.log4j.ConsoleAppender
log4j.appender.console.layout=org.apache.log4j.patternlayout
Log4j.appender.console.layout.conversionpattern=%-d{yyyy-mm-dd HH:MM:SS} [%t]%-5p [%c]-%m%n
#RollingFile
Log4j.appender.rollingfile=org.apache.log4j.dailyrollingfileappender
log4j.appender.rollingfile.file=. /logs/phexam-stderr.log
log4j.appender.RollingFile.Threshold = ERROR
Log4j.appender.RollingFile.DatePattern = Yyyy-mm-dd '. Log '
log4j.appender.rollingfile.layout= Org.apache.log4j.PatternLayout
log4j.appender.rollingfile.layout.conversionpattern=%-d{yyyy-mm-dd hh\:mm\: SS} [%t]%-5p [%c]-%m%n


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.