1

I have a simple Java application (NOT a Web app, so there is no WEB-INF/ or any Web functionality).

The simple Java app utilizes Spring 3.1 to load/manage objects.

The issue is that when it runs, I see these log statements, which I don't want to see.

Mar 15, 2014 2:19:59 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@4848268a: startup date [Sat Mar 15 14:19:59 EDT 2014]; root of context hierarchy
Mar 15, 2014 2:19:59 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [springtest/beans.xml]
Mar 15, 2014 2:19:59 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@c7b2b3e: defining beans [testbean]; root of factory hierarchy

I manually added a new file called log4j.properties in the same folder as the class with main(), which I run. This didn't help.

log4j.properties (same folder as class with main())

log4j.category.org.springframework=WARN

I rebuild the project, clean, and run the class, and still see this output.

EDIT: I verified that log4j.properties gets placed in my classpath, it is copied to build\classes\ and I can see it there after I build.

I followed the examples from here, but nothing helped. I do not have a Web app. Disabling Spring log, to have readable logs How to turn off Spring 3 debug logging?

Community
  • 1
  • 1
gene b.
  • 10,512
  • 21
  • 115
  • 227
  • 1
    I think log4j.properties should be in the classpath root. Check out the advices here: http://stackoverflow.com/questions/5081316/where-is-the-correct-location-to-put-log4j-properties-in-an-eclipse-project. Maybe this will help – makasprzak Mar 15 '14 at 18:32
  • Yes, the file gets copied to my build\classes\ dir. which is in the classpath, I've confirmed that. However, with the line above, there is no effect. – gene b. Mar 15 '14 at 18:41
  • Do you have log4j jar file in your CLASSPATH? – Shinichi Kai Mar 15 '14 at 21:16
  • Check [this question](http://stackoverflow.com/questions/21739578/how-to-disable-spring-logging-debug-messages/21748252?noredirect=1#comment32996059_21748252) to see if that helps – Stephane Nicoll Mar 17 '14 at 12:34

0 Answers0