如何阻止Spring的默认输出?

我是Spring的新手。 当我运行Spring批处理应用程序时,我希望只能看到“Hello World!”,而是获得以下额外细节 –

 org.springframework.context.support.AbstractApplicationContext prepareRefresh INFO:刷新org.springframework.context.support.ClassPathXmlApplicationContext@4e660b27:启动日期[Thu May 03 12:28:42 EDT 2012]; 2012年5月3日12:28:42 org.springframework.context.support.AbstractApplicationContext prepareRefresh INFO:Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@4e660b27  org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions INFO:从类路径资源加载XML bean定义[helloWorldJob.xml] 2012年5月3日12:28:43上下文层次结构的根目录2012年5月3日12:28:42 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions INFO:从类路径资源加载XML bean定义[MEMORY-JOBREPOSITORY.xml] May 03,2012 12:28:44 PM org.springframework.beans.factory.support。 DefaultListableBeanFactory registerBeanDefinition INFO:覆盖bean'helloWorldJob'的bean定义:替换[Generic bean:class [org.springframework.batch.core.configuration.xml.SimpleFlowFactoryBean]; 范围=; 抽象= FALSE;  lazyInit = FALSE;  autowireMode = 0;  dependencyCheck = 0;  autowireCandidate = TRUE; 初级= FALSE;  factoryBeanName = NULL;  factoryMethodName = NULL;  initMethodName = NULL;  destroyMethodName = null] with [Generic bean:class [org.springframework.batch.core.configuration.xml.JobParserJobFactoryBean]; 范围=; 抽象= FALSE;  lazyInit = FALSE;  autowireMode = 0;  dependencyCheck = 0;  autowireCandidate = TRUE; 初级= FALSE;  factoryBeanName = NULL;  factoryMethodName = NULL;  initMethodName = NULL;  destroyMethodName = null] May 03,2012 12:28:44 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons INFO:在org.springframework.beans.factory.support.DefaultListableBeanFactory@63dfb24d中预实例化单例:定义bean [ jobRepository,jobRepository-transactionManager的,jobLauncher,你好,世界,org.springframework.batch.core.scope.internalStepScope,org.springframework.beans.factory.config.CustomEditorConfigurer,org.springframework.batch.core.configuration.xml.CoreNamespacePostProcessor, step0,步骤1,helloWorldJob]; 工厂层次结构根据2012年5月3日12:28:44 org.springframework.aop.framework.DefaultAopProxyFactory INFO:CGLIB2可用:启用proxyTargetClassfunction2012年5月3日下午12:28:44 org.springframework.batch.core.launch .support.SimpleJobLauncher afterPropertiesSet INFO:没有设置TaskExecutor,默认为同步执行程序。  2012年5月3日12:28:44 org.springframework.batch.core.launch.support.SimpleJobLauncher $ 1运行INFO:Job:[FlowJob:[name = helloWorldJob]]使用以下参数启动:[{time = 11: orm.springframework.batch.core.job.SimpleStepHandler handleStep INFO:执行步骤:[step0] HelloMay 03,2012 12:28:44 PM org.springframework.batch.core 06 AM} 2012年5月3日12:28:44 org.springframework.batch.core.job.SimpleStepHandler handleStep INFO:执行步骤:[step0] HelloMay 03,2012 12:28:44 PM org.springframework.batch.core .job.SimpleStepHandler handleStep INFO:执行步骤:[step1] World!May 03,2012 12:28:44 PM org.springframework.batch.core.launch.support.SimpleJobLauncher $ 1运行INFO:Job:[FlowJob:[name = helloWorldJob]]使用以下参数完成:[{time = 11:06AM}]和以下状态:[COMPLETED] 2012年5月3日12:28:44 org.springframework.context.support.AbstractApplicationContext doClose INFO:关闭组织.springframework.context.support.ClassPathXmlApplicationContext @ 4e660b27:启动日期[Thu May 03 12:28:42 EDT 2012];  org.springframework.beans.factory.support.DefaultSingletonBeanRegistry destroySingletons INFO:在org.springframework.beans.factory.support.DefaultListableBeanFactory@63dfb24d中销毁单例:定义bean [jobRepository, jobRepository-transactionManager的,jobLauncher,你好,世界,org.springframework.batch.core.scope.internalStepScope,org.springframework.beans.factory.config.CustomEditorConfigurer,org.springframework.batch.core.configuration.xml.CoreNamespacePostProcessor,step0,步骤1,helloWorldJob]; 工厂层级的根 

如何防止这些额外的东西出现? 谢谢。

其他信息 – log4j.xml

                  

您可以切换到Log4J日志记录并将日志级别设置为ERROR或FATAL 。 这样就可以停用所有非错误日志记录。

但戴夫牛顿是对的:这听起来像个坏主意。