Thursday, May 3, 2012

Configure log4j for Spring MVC

1. Add following to web.xml


    log4jConfigLocation
    
    classpath:log4j.properties


    log4jExposeWebAppRoot
    false




    org.springframework.web.util.Log4jConfigListener

2. Create log4j factory bean in applicationContext.xml


3. Use it


@Component
public class SomeComponent{
    private Log logger;
  
    @Resource
    public void setLogger(Log logger){
       this.logger=logger;
    }


}

Sample log4j.properties
Spring MVC Sample Project

40 comments:

  1. Replies
    1. Big data is a term that describes the large volume of data – both structured and unstructured – that inundates a business on a day-to-day basis. big data projects for students But it’s not the amount of data that’s important.Project Center in Chennai

      Spring Framework has already made serious inroads as an integrated technology stack for building user-facing applications. Corporate TRaining Spring Framework the authors explore the idea of using Java in Big Data platforms.

      Spring Training in Chennai

      The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training

      Delete
  2. Very happy to see this blog. Gives a wonderful information with coded explanaion. Thank you for this blog. very useful to me.
    Java Training in Chennai

    ReplyDelete
  3. I have read your blog its very attractive and impressive. I like it your blog.

    Java Training in Chennai Core Java Training in Chennai Core Java Training in Chennai

    Java Online Training Java Online Training Core Java 8 Training in Chennai Core java 8 online training JavaEE Training in Chennai Java EE Training in Chennai

    ReplyDelete
  4. I have read your blog its very attractive and impressive. I like it your blog.

    Java Training in Chennai Core Java Training in Chennai Core Java Training in Chennai

    ReplyDelete
  5. Java Online Training Java Online Training Core Java 8 Training in Chennai Core java 8 online training JavaEE Training in Chennai Java EE Training in Chennai

    ReplyDelete
  6. Thanks for sharing this unique information with us. Your post is really awesome. Your blog is really helpful for me..
    Top college in Jaipur

    ReplyDelete
  7. Thanks for sharing this unique information with us. Your post is really awesome. Your blog is really helpful for me..
    organic oil
    organic oil in jaipur
    organic cold pressed oils
    ayurvedic oil store in jaipur

    ReplyDelete
  8. Does your blog have a contact page? I’m having problems locating it but, I’d like to shoot you an email. I’ve got some recommendations for your blog you might be interested in hearing.
    AWS Training in Chennai |Best Amazon Web Services Training in Chennai
    Best AWS Amazon Web Services Training in Chennai | AWS Training in Chennai cost
    No.1 AWS Training in Chennai | Amazon Web Services Training Institute in Chennai

    ReplyDelete
  9. Great Article… I love to read your articles because your writing style is too good, its is very very helpful for all of us and I never get bored while reading your article because, they are becomes a more and more interesting from the starting lines until the end. 
    microsoft azure training in bangalore
    rpa training in bangalore
    best rpa training in bangalore

    ReplyDelete
  10. Excellent blog, I wish to share your post with my folks circle. It’s really helped me a lot, so keep sharing post like this
    Best Devops online Training
    Online DevOps Certification Course - Gangboard
    Best Devops Training institute in Chennai

    ReplyDelete
  11. I would assume that we use more than the eyes to gauge a person's feelings. Mouth. Body language. Even voice. You could at least have given us a face in this test.
    python Course in Pune
    python Course institute in Chennai
    python Training institute in Bangalore

    ReplyDelete
  12. Nice article
    For Data Science training in Bangalore, Visit:
    Data Science training in bangalore

    ReplyDelete
  13. Wow it is really wonderful and awesome thus it is veWow, it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot.

    python training in bangalore

    python courses in bangalore

    python classes in bangalore

    python training institute in bangalore

    python course syllabus

    best python training

    python training centers

    ReplyDelete
  14. This is the exact information I am been searching for, Thanks for sharing the required infos with the clear update and required points. To appreciate this I like to share some useful information.

    aws training in bangalore

    aws courses in bangalore

    aws classes in bangalore

    aws training institute in bangalore

    aws course syllabus

    best aws training

    aws training centers

    ReplyDelete
  15. Such a great information for blogger iam a professional blogger thanks…

    Get Best Dell Boomi Training in Bangalorev from Real Time Industry Experts with 100% Placement Assistance in MNC Companies. Book your Free Demo with Softgen Infotech.

    ReplyDelete
  16. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up. spring boot certification course!

    ReplyDelete
  17. Big data is a term that describes the large volume of data – both structured and unstructured – that inundates a business on a day-to-day basis. big data projects for students But it’s not the amount of data that’s important.Project Center in Chennai


    Spring Framework has already made serious inroads as an integrated technology stack for building user-facing applications. Corporate TRaining Spring Framework the

    authors explore the idea of using Java in Big Data platforms.

    Spring Training in Chennai


    The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training Project Centers in Chennai

    ReplyDelete
  18. I just loved your article on the beginners guide to starting a blog.If somebody take this blog article seriously
    in their life, he/she can earn his living by doing blogging.Thank you for this articl
    Uipath training in bangalore

    ReplyDelete
  19. Great post. keep sharing such a worthy information.
    Appium Training Online

    ReplyDelete
  20. Catch up with our Selenium training in Chennai from Infycle Technologies, the best software training institute in Chennai for working tech professionals, students, freshers, experienced and women techies. At Infycle, get rock-solid demanding courses like Machine Learning, Graphic Design and Animation, Artificial Intelligence, Cyber Security, Blockchain, Java for Android and iOS Development, Big Data, Oracle, Python, Microsoft Azure, Manual, and Data Science, Medical Coding, etc., with the best trainers in the industry. For more info and the free demo, reach us on call at +91-7504633633, +91-7502633633.

    ReplyDelete