我有一个使用Struts2(2.3.15.3)构建的Web应用程序,用于部署在Oracle Weblogic 12c上的MVC。 Web应用程序工作正常,只是在Weblogic中部署时,它会从Weblogic std IO上的struts代码中打印一些额外的信息消息,这些消息不是必需的。
我尝试通过将最低严重性调整为日志值并将日志记录实现从默认JDK更改为log4j来配置Weblogic日志服务,但这也无济于事。
它会将这些信息消息从struts打印到std输出。我想我最不想做的就是玩LogFilterMBean
并编写自定义日志过滤器。有关这些的任何建议吗? TIA
Jan 28, 2014 12:21:44 PM IST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING.>
2014-01-28 12:21:48,352:INFO :[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': Parsing configuration file [struts-default.xml] [system]: XmlConfigurationProvider
2014-01-28 12:21:48,410:INFO :[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': Unable to locate configuration files of the name struts-plugin.xml, skipping [system]: XmlConfigurationProvider
2014-01-28 12:21:48,411:INFO :[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': Parsing configuration file [struts-plugin.xml] [system]: XmlConfigurationProvider
2014-01-28 12:21:48,465:INFO :[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': Parsing configuration file [struts.xml] [system]: XmlConfigurationProvider
2014-01-28 12:21:48,469:INFO :[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': Choosing bean (struts) for (com.opensymphony.xwork2.ObjectFactory) [system]: BeanSelectionProvider
2014-01-28 12:21:48,470:INFO :[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': Choosing bean (struts) for (com.opensymphony.xwork2.FileManagerFactory) [system]: BeanSelectionProvider
2014-01-28 12:21:48,470:INFO :[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': Choosing bean (struts) for (com.opensymphony.xwork2.conversion.impl.XWorkConverter) [system]: BeanSelectionProvider
2014-01-28 12:21:48,471:INFO :[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': Choosing bean (struts) for (com.opensymphony.xwork2.conversion.impl.CollectionConverter) [system]: BeanSelectionProvider
2014-01-28 12:21:48,471:INFO :[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': Choosing bean (struts) for (com.opensymphony.xwork2.conversion.impl.ArrayConverter) [system]: BeanSelectionProvider
2014-01-28 12:21:48,471:INFO :[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': Choosing bean (struts) for (com.opensymphony.xwork2.conversion.impl.DateConverter) [system]: BeanSelectionProvider
2014-01-28 12:21:48,472:INFO :[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': Choosing bean (struts) for (com.opensymphony.xwork2.conversion.impl.NumberConverter) [system]: BeanSelectionProvider
2014-01-28 12:21:48,472:INFO :[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': Choosing bean (struts) for (com.opensymphony.xwork2.conversion.impl.StringConverter) [system]: BeanSelectionProvider
2014-01-28 12:21:48,472:INFO :[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': Choosing bean (struts) for (com.opensymphony.xwork2.conversion.ConversionPropertiesProcessor) [system]: BeanSelectionProvider
2014-01-28 12:21:48,472:INFO :[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': Choosing bean (struts) for (com.opensymphony.xwork2.conversion.ConversionFileProcessor) [system]: BeanSelectionProvider
2014-01-28 12:21:48,473:INFO :[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': Choosing bean (struts) for (com.opensymphony.xwork2.conversion.ConversionAnnotationProcessor) [system]: BeanSelectionProvider
2014-01-28 12:21:48,473:INFO :[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': Choosing bean (struts) for (com.opensymphony.xwork2.conversion.TypeConverterCreator) [system]: BeanSelectionProvider
2014-01-28 12:21:48,473:INFO :[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': Choosing bean (struts) for (com.opensymphony.xwork2.conversion.TypeConverterHolder) [system]: BeanSelectionProvider
2014-01-28 12:21:48,473:INFO :[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': Choosing bean (struts) for (com.opensymphony.xwork2.TextProvider) [system]: BeanSelectionProvider
2014-01-28 12:21:48,473:INFO :[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': Choosing bean (struts) for (com.opensymphony.xwork2.LocaleProvider) [system]: BeanSelectionProvider
2014-01-28 12:21:48,473:INFO :[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': Choosing bean (struts) for (com.opensymphony.xwork2.ActionProxyFactory) [system]: BeanSelectionProvider
2014-01-28 12:21:48,474:INFO :[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': Choosing bean (struts) for (com.opensymphony.xwork2.conversion.ObjectTypeDeterminer) [system]: BeanSelectionProvider
2014-01-28 12:21:48,474:INFO :[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': Choosing bean (struts) for (org.apache.struts2.dispatcher.mapper.ActionMapper) [system]: BeanSelectionProvider
2014-01-28 12:21:48,474:INFO :[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': Choosing bean (jakarta) for (org.apache.struts2.dispatcher.multipart.MultiPartRequest) [system]: BeanSelectionProvider
2014-01-28 12:21:48,474:INFO :[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': Choosing bean (struts) for (org.apache.struts2.views.freemarker.FreemarkerManager) [system]: BeanSelectionProvider
2014-01-28 12:21:48,474:INFO :[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': Choosing bean (struts) for (org.apache.struts2.views.velocity.VelocityManager) [system]: BeanSelectionProvider
2014-01-28 12:21:48,474:INFO :[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': Choosing bean (struts) for (org.apache.struts2.components.UrlRenderer) [system]: BeanSelectionProvider
2014-01-28 12:21:48,474:INFO :[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': Choosing bean (struts) for (com.opensymphony.xwork2.validator.ActionValidatorManager) [system]: BeanSelectionProvider
2014-01-28 12:21:48,475:INFO :[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': Choosing bean (struts) for (com.opensymphony.xwork2.util.ValueStackFactory) [system]: BeanSelectionProvider
2014-01-28 12:21:48,475:INFO :[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': Choosing bean (struts) for (com.opensymphony.xwork2.util.reflection.ReflectionProvider) [system]: BeanSelectionProvider
2014-01-28 12:21:48,475:INFO :[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': Choosing bean (struts) for (com.opensymphony.xwork2.util.reflection.ReflectionContextFactory) [system]: BeanSelectionProvider
2014-01-28 12:21:48,475:INFO :[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': Choosing bean (struts) for (com.opensymphony.xwork2.util.PatternMatcher) [system]: BeanSelectionProvider
2014-01-28 12:21:48,475:INFO :[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': Choosing bean (struts) for (org.apache.struts2.dispatcher.StaticContentLoader) [system]: BeanSelectionProvider
2014-01-28 12:21:48,475:INFO :[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': Choosing bean (struts) for (com.opensymphony.xwork2.UnknownHandlerManager) [system]: BeanSelectionProvider
2014-01-28 12:21:48,476:INFO :[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': Choosing bean (struts) for (org.apache.struts2.views.util.UrlHelper) [system]: BeanSelectionProvider
2014-01-28 12:21:48,476:INFO :[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': Choosing bean (struts) for (com.opensymphony.xwork2.util.TextParser) [system]: BeanSelectionProvider
2014-01-28 12:21:48,690:INFO :[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': WebLogic server detected. Enabling Struts parameter
答案 0 :(得分:2)
您可以使用xwork.loggerFactory
系统属性指定要与Struts2框架一起使用的自定义记录器工厂。默认情况下,它按照它们的显示顺序选择公共日志记录或slf4j。如何编写记录器工厂,您可以找到here。
对于使用log4j进行日志记录的公共文件,您可以配置log4j
配置文件,例如属性
log4j.logger.org.apache=ERROR,Console
log4j.logger.com.opensymphony.xwork2=ERROR,Console
log4j.logger.com.opensymphony.xwork2.interceptor=ERROR
log4j.logger.com.opensymphony.xwork2.ognl=ERROR
log4j.logger.freemarker=ERROR,Console
您在我的案例中使用的是Console
的appender,但您可以更改此内容。服务器应该通过抑制INFO
级别立即对此作出反应。