在 Weblogic 12c 启动期间出现的来自 Struts 的额外信息消息
我有一个使用 Struts2 (2.3.15.3) 构建的 Web 应用程序,用于部署在 Oracle Weblogic 12c 上的 MVC.Web 应用程序运行良好,只是当它部署在 Weblogic 中时,它会在 Weblogic std IO 上打印一些来自 struts 代码的额外信息消息,这不是必需的.
我尝试通过将最小严重性调整为日志值并将日志实现从默认 JDK 更改为 log4j 来配置 Weblogic 日志服务,但这也无济于事.
它不断将这些信息消息从 struts 打印到 std 输出.我认为我想做的最后一件事是使用 LogFilterMBean
并编写自定义日志过滤器.围绕这些有什么建议吗?TIA
2014 年 1 月 28 日 12:21:44 PM IST><通知><WebLogicServer><BEA-000365><服务器状态更改为 STARTING.>2014-01-28 12:21:48,352:INFO:[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': 解析配置文件 [struts-default.xml] [system]: XmlConfigurationProvider2014-01-28 12:21:48,410:INFO:[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': 找不到名为 struts-plugin.xml 的配置文件, 跳过 [system]: XmlConfigurationProvider2014-01-28 12:21:48,411:INFO:[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': 解析配置文件 [struts-plugin.xml] [system]: XmlConfigurationProvider2014-01-28 12:21:48,465:INFO:[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': 解析配置文件 [struts.xml] [system]: XmlConfigurationProvider2014-01-28 12:21:48,469:INFO:[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': 为 (com.opensymphony.xwork2.ObjectFactory) [系统]: BeanSelectionProvider2014-01-28 12:21:48,470:INFO:[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': 为 (com.opensymphony.xwork2.FileManagerFactory) [系统]: BeanSelectionProvider2014-01-28 12:21:48,470:INFO:[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': 为 (com.opensymphony.xwork2.conversion.impl.XWorkConverter) [系统]: BeanSelectionProvider2014-01-28 12:21:48,471:INFO:[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': 为 (com.opensymphony.xwork2.conversion.impl.CollectionConverter) [系统]: BeanSelectionProvider2014-01-28 12:21:48,471:INFO:[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': 为 (com.opensymphony.xwork2.conversion.impl.ArrayConverter) [系统]: BeanSelectionProvider2014-01-28 12:21:48,471:INFO:[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': 为 (com.opensymphony.xwork2.conversion.impl.DateConverter) [系统]: BeanSelectionProvider2014-01-28 12:21:48,472:INFO:[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': 为 (com.opensymphony.xwork2.conversion.impl.NumberConverter) [系统]: BeanSelectionProvider2014-01-28 12:21:48,472:INFO:[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': 为 (com.opensymphony.xwork2.conversion.impl.StringConverter) [系统]: BeanSelectionProvider2014-01-28 12:21:48,472:INFO:[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': 为 (com.opensymphony.xwork2.conversion.ConversionPropertiesProcessor) [系统]: BeanSelectionProvider2014-01-28 12:21:48,472:INFO:[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': 为 (com.opensymphony.xwork2.conversion.ConversionFileProcessor) [系统]: BeanSelectionProvider2014-01-28 12:21:48,473:INFO:[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': 为 (com.opensymphony.xwork2.conversion.ConversionAnnotationProcessor) [系统]: BeanSelectionProvider2014-01-28 12:21:48,473:INFO:[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': 为 (com.opensymphony.xwork2.conversion.TypeConverterCreator) [系统]: BeanSelectionProvider2014-01-28 12:21:48,473:INFO:[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': 为 (com.opensymphony.xwork2.conversion.TypeConverterHolder) [系统]: BeanSelectionProvider2014-01-28 12:21:48,473:INFO:[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': 为 (com.opensymphony.xwork2.TextProvider) [系统]: BeanSelectionProvider2014-01-28 12:21:48,473:INFO:[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': 为 (com.opensymphony.xwork2.LocaleProvider) [系统]: BeanSelectionProvider2014-01-28 12:21:48,473:INFO:[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': 为 (com.opensymphony.xwork2.ActionProxyFactory) [系统]: BeanSelectionProvider2014-01-28 12:21:48,474:INFO:[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': 为 (com.opensymphony.xwork2.conversion.ObjectTypeDeterminer) [系统]: BeanSelectionProvider2014-01-28 12:21:48,474:INFO:[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': 为 (org.apache.struts2.dispatcher.mapper.ActionMapper) [系统]: BeanSelectionProvider2014-01-28 12:21:48,474:INFO:[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': 为 (org.apache.struts2.dispatcher.multipart.MultiPartRequest) [系统]: BeanSelectionProvider2014-01-28 12:21:48,474:INFO:[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': 为 (org.apache.struts2.views.freemarker.FreemarkerManager) [系统]: BeanSelectionProvider2014-01-28 12:21:48,474:INFO:[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': 为 (org.apache.struts2.views.velocity.VelocityManager) [系统]: BeanSelectionProvider2014-01-28 12:21:48,474:INFO:[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': 为 (org.apache.struts2.components.UrlRenderer) [系统]: BeanSelectionProvider2014-01-28 12:21:48,474:INFO:[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': 为 (com.opensymphony.xwork2.validator.ActionValidatorManager) [系统]: BeanSelectionProvider2014-01-28 12:21:48,475:INFO:[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': 为 (com.opensymphony.xwork2.util.ValueStackFactory) [系统]: BeanSelectionProvider2014-01-28 12:21:48,475:INFO:[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': 为 (com.opensymphony.xwork2.util.reflection.ReflectionProvider) [系统]: BeanSelectionProvider2014-01-28 12:21:48,475:INFO:[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': 为 (com.opensymphony.xwork2.util.reflection.ReflectionContextFactory) [系统]: BeanSelectionProvider2014-01-28 12:21:48,475:INFO:[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': 为 (com.opensymphony.xwork2.util.PatternMatcher) [系统]: BeanSelectionProvider2014-01-28 12:21:48,475:INFO:[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': 为 (org.apache.struts2.dispatcher.StaticContentLoader) [系统]: BeanSelectionProvider2014-01-28 12:21:48,475:INFO:[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': 为 (com.opensymphony.xwork2.UnknownHandlerManager) [系统]: BeanSelectionProvider2014-01-28 12:21:48,476:INFO:[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': 为 (org.apache.struts2.views.util.UrlHelper) [系统]: BeanSelectionProvider2014-01-28 12:21:48,476:INFO:[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)': 为 (com.opensymphony.xwork2.util.TextParser) [系统]: BeanSelectionProvider2014-01-28 12:21:48,690:INFO:[ACTIVE] ExecuteThread:'0' for queue:'weblogic.kernel.Default (self-tuning)':检测到 WebLogic 服务器.启用 Struts 参数
解决方案 您可以使用 xwork.loggerFactory
系统属性来指定与 Struts2 框架一起使用的自定义记录器工厂.默认情况下,它会按照出现的顺序选择 commons logging 或 slf4j.如何编写一个记录器工厂你可以找到这里.p>
对于使用 log4j 进行公共日志记录,您可以配置 log4j
配置文件,例如属性
log4j.logger.org.apache=错误,控制台log4j.logger.com.opensymphony.xwork2=错误,控制台log4j.logger.com.opensymphony.xwork2.interceptor=错误log4j.logger.com.opensymphony.xwork2.ognl=错误log4j.logger.freemarker=错误,控制台
在我的例子中,您使用的附加程序是 Console
,但您可以更改它.服务器应立即通过抑制 INFO
级别对此做出反应.
I have a web application which is built using Struts2 (2.3.15.3) for MVC deployed on Oracle Weblogic 12c. The web app is working perfectly fine as is, just that when it is deployed in Weblogic, It prints some some extra info messages from struts code on the Weblogic std IO which is not required.
I have tried configuring the Weblogic logging servives by tweaking minimum severity to log value and changing the logging implementation to log4j from default JDK but that didn't help either.
It keeps printing these info messages from struts to the std output. I think the last thing I would want to do is play with LogFilterMBean
and write a custom log filter. Any suggestion around these? 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
解决方案
You can use xwork.loggerFactory
system property to specify a custom logger factory to use with the Struts2 framework. By default it chooses commons logging or slf4j in the order they are presented. How to write a logger factory you can find here.
For commons logging with log4j you can configure log4j
configuration file, properties for example
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
What appenders you use in my case is Console
, but you can change this. The server should react on this immediately by suppressing INFO
level.
相关文章