| 注册
请输入搜索内容

热门搜索

Java Linux MySQL PHP JavaScript Hibernate jQuery Nginx

请问为什么日志会打印2次?

0
Apache XML C/C++ log4j list 1175 次浏览

环境配置如下:spring3 hibernate4 Apache Tomcat/7.0.47 JDK1.7.0.59 
                            log4j 1.2.17 

使用spring MVC,关于log4j的web.xml地方配置如下: 
<context-param> 
<param-name>log4jConfigLocation</param-name> 
<!-- 开发环境 --> 
<param-value>classpath:properties/development/log4j.properties</param-value> 
<!-- 生产环境 --> 
<!-- <param-value>classpath:properties/production/log4j.properties</param-value> --> 
<!-- 测试环境 --> 
<!-- <param-value>classpath:properties/testing/log4j.properties</param-value> --> 
</context-param> 
  
  <!-- Spring的log4j监听器 --> 
  <listener> 
  <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class> 
  </listener> 

log4j.properties配置如下: 
log4j.rootLogger=debug, Console, test, Spring, Hibernate 

#log4j.appender.rootlog=org.apache.log4j.DailyRollingFileAppender 
#log4j.appender.rootlog.file=../logs/All.log 
#log4j.appender.rootlog.layout=org.apache.log4j.PatternLayout 
#log4j.appender.rootlog.Append=true 
#log4j.appender.rootlog.DatePattern='-'yyyy-MM-dd'.log'  
#log4j.appender.rootlog.layout=org.apache.log4j.PatternLayout 
#log4j.appender.rootlog.layout.ConversionPattern=%-5d [%-4p] [%r] [%t] [%l] - %m%n 

#Console 
log4j.appender.Console=org.apache.log4j.ConsoleAppender 
log4j.appender.Console.Target=System.out 
log4j.appender.Console.layout=org.apache.log4j.PatternLayout 
log4j.appender.Console.layout.ConversionPattern=%-5d [%-4p] [%r] [%t] [%l] - %m%n 

#test 
log4j.logger.test=debug,Mall 
log4j.appender.test=org.apache.log4j.DailyRollingFileAppender 
log4j.appender.test.File=../logs/test.log 
log4j.appender.test.Append=true 
log4j.appender.test.DatePattern='-'yyyy-MM-dd'.log'  
log4j.appender.test.layout=org.apache.log4j.PatternLayout 
log4j.appender.test.layout.ConversionPattern=%-5d [%-4p] [%r] [%t] [%l] - %m%n 


原来tomcat的日志都往catania.out打印,非常不方便,改造后,日志能按要求在tesg.log记录了,但是里面的日志内容都是双份。 
如: 




而且catania.out中也会有日志。请教下如何能不打印双份日志记录,并且catania.out也不记录业务日志了,可以记录tocmat启动的信息,tomcat配置没做什么改动,它仍然输出localhost和manager日志

36个答案

0

Great article, but a frustrating read, due to the lack of proper punctuation in a lot of spots. Please close your quotations! If this article is following some sort of nouveau grammatical style, of which I’m not aware, I remain frustrated; however, I apologize. Колко кафета се правят от килограм кафе на зърна? 







======================================================







Hi there for your personal broad critique, then again particularly passionate the recent Zune, and additionally intend this specific, not to mention the beneficial feedbacks other sorts of everyone has posted, will determine if is it doesn’t answer you’re looking for. уроци по лека атлетика София

0

You make so many great points here that I read your article a couple of times. Your views are in accordance with my own for the most part. This is great content for your readers. Most Realistic Sex Doll

0

Thanks for the nice blog. It was very useful for me. I'm happy I found this blog. Thank you for sharing with us,I too always learn something new from your post. เกมสล็อต ค่าย pgใหม่ล่าสุด

0

Thank you so much as you have been willing to share information with us. We will forever admire all you have done here because you have made my work as easy as ABC. immediate voyance

0

Super-Duper site! I am Loving it!! Will come back again, Im taking your feed also, Thanks. mm88bet ทางเข้า

0

I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well. Thanks... 카지노커뮤니티

0

You produced some decent points there. I looked on the internet for any problem and found most people may go along with with your site. CBT

0

This is exactly such a great reserve that you re giving about this topic and people offer it away plagued approachable. 메이저사이트

0

Hello! I simply would like to give a huge thumbs up for the great info you’ve here on this post. I might be coming back to your weblog for more soon. 정보이용료

0

I just added this blog site to my feed reader, excellent stuff. Cannot get enough! булчински рокли

0

I think other website owners should take this website as an model, very clean and superb user genial design and style . How to be a credit card processor

0

Thanks For sharing this Superb article.I use this Article to show my assignment in college.it is useful For me Great Work. 메이저사이트

0

That is a beneficial viewpoint, however isn’t make every sence whatsoever dealing with which mather. Any method thanks in addition to i had make an effort to share your current post straight into delicius but it surely is apparently an issue using your websites is it possible to you should recheck this. many thanks again. become a credit card processor

 

=============================================

 

 

Some truly nice stuff on this site, I love it. Merchant Service Agent

 

 

==============================================

 

 

Good post. I learn something tougher on different blogs everyday. It'll at all times be stimulating to learn content from other writers and observe somewhat one thing from their store. I’d choose to use some with the content on my blog whether or not you don’t mind. Natually I’ll offer you a link in your internet blog. Thanks for sharing. Merchant Services Partnerships

0

Thanks because you have been willing to talk about information with us. we will always appreciate all you have done here because I understand you are very focused on our. Robinhood alternatives

 

=============================================================

 

 

Your content is nothing short of bright in many forms. I think this is friendly and eye-opening material. I have gotten so many ideas from your blog. Thank you so much. when to buy cryptocurrency and when to sell

0

This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free. Crypto Merchant Acceptance

0

I’m impressed aided by the surpassing not to mention preachy advertising for which you embellish in such bit timing. 안전놀이터

0

Beneficial Write-up, My business is an enormous believer with placing reviews with web-sites to help allow blog site internet writers are conscious that they’ve added in anything effective to help online! Merchant Service Agent Program

0

ดาวน์โหลดjoker123 auto Online slots, mobile phones, new online slots games, online slots that are the hottest in 2020, with low capital, can play.

0

ทางเข้า joker123 Top camp slots games Genuine license from PGSLOT game camp, online slots, direct web slot game service.

0

joker PG SLOT Game is a new and hot slot game that is gaining popularity right now, online slots, direct websites, not through agents.

1 2