Configure the Tomcat output log File

Source: Internet
Author: User

The latest project always has a 404 error. The error message is not displayed on the console. I can't see it either under Tomcat.

The cause of the Error. Later, I found a method on the Internet to print the tomcat record information. First in Tomcat

In the installation directory of the common/classes/uninstalled tomcat, you can find the unzip package of tomcat.

The content of the log4j. properties file is

 

 
 
  1. log4j.rootLogger=info,Console,R   
  2.  
  3. log4j.appender.Console=org.apache.log4j.ConsoleAppender  
  4.  
  5. log4j.appender.Console.layout=org.apache.log4j.PatternLayout  
  6.  
  7. #log4j.appender.Console.layout.ConversionPattern=%d [%t] %-5p %c - %m%n  
  8.  
  9. log4j.appender.Console.layout.ConversionPattern=%d{yy-MM-dd HH:mm:ss} %5p %c{1}:%L - %m%n  
  10.  
  11.    
  12.  
  13. log4j.appender.R=org.apache.log4j.DailyRollingFileAppender  
  14.  
  15. log4j.appender.R.File=${catalina.home}/logs/tomcat.log   
  16.  
  17. log4j.appender.R.layout=org.apache.log4j.PatternLayout  
  18.  
  19. log4j.appender.R.layout.ConversionPattern=%d{yyyy.MM.dd HH:mm:ss} %5p %c{1}(%L):? %m%n   
  20.  
  21.    
  22.  
  23. log4j.logger.org.apache=info,R  
  24.  
  25. log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost]=DEBUG, R   
  26.  
  27. log4j.logger.org.apache.catalina.core=info,R  
  28.  
  29. log4j.logger.org.apache.catalina.session=info,R  
  30.  

Then add the commons-logging.jar, log4j. jar in the common/lib, and then generate

The File name and output path of a tomcat. log File can also be repaired in the above log4j. appender. R. File

), The specific error information can be found above. If eclipse is used, it can be directly found on the console.

To see the error message. This problem plagued me for one night. Finally, the ing files and

The entity class is not read in applicationContext. xml. If you think there is too little information on the console

Use this method to view details. I hope it will be useful to everyone. Of course, I will laugh at it.

This article is from the "Just do it" blog, be sure to keep this source http://davenzeng.blog.51cto.com/3896952/1143993

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.