I have a standalone (not web) application using JavaConfig and when I start the app I get the following log entries:

2009/01/16 20:59:36:529 GMT [INFO] JavaConfigApplicationContext - Refreshing org.springframework.config.java.context.JavaConfig ApplicationContext@4c2d0479: display name [org.springframework.config.java.context.JavaConfig ApplicationContext@4c2d0479]; startup
date [Fri Jan 16 20:59:36 GMT 2009]; root of context hierarchy
2009/01/16 20:59:36:667 GMT [INFO] JavaConfigApplicationContext - Bean factory for application context [org.springframework.config.java.context.JavaConfig ApplicationContext@4c2d0479]: org.springframework.beans.factory.support.DefaultL istableBeanFactory@4d16318b
2009/01/16 20:59:37:054 GMT [INFO] ConfigurationModelBeanDefinitionReader - Registering PUBLIC bean definition for @Configuration ... etc.

I have tried to control the logging with the following @Configuration class:

@Configuration(defaultLazy = Lazy.FALSE)
public class Log4jConfig {
@Bean(lazy = Lazy.FALSE)
public MethodInvokingFactoryBean log4jInitialization() {
final MethodInvokingFactoryBean bean =
new MethodInvokingFactoryBean();
bean.setTargetClass(Log4jConfigurer.class);
bean.setTargetMethod("initLogging");
bean.setArguments(new Object[] {"spring-log4j.xml"});

return bean;
}
}

... but it doesn't seem to work - the app still spews the same log entries as before. The @Bean corresponds to the bean definition XML that supposedly controls log4j settings in a Spring XML configuration.

Any ideas?

Thanks in advance.