简体   繁体   English

在Hybris控制台中处理警告

[英]Handling Warnings in Hybris Console

Going through my tomcat log, I have noticed this warning: 通过我的tomcat日志,我注意到了以下警告:

 WARN  | localhost-startStop-1 |   |  | ReleaseStrategyFactoryBean:116 | No target supplied; falling back to SequenceSizeReleaseStrategy

And I was wondering if there was a way to prevent this warning from appearing in the console? 我想知道是否有办法防止此警告出现在控制台中?

EDIT: apparently, and according to this link , the warning happens if no method name is provided and no annotated method is found, or a null reference is provided. 编辑:显然,根据此链接 ,如果未提供方法名称且未找到带注释的方法,或者提供了空引用,则会发生警告。

So if I'm not mistaken it's something internal to Spring, and therefore I can't do anything to stop the warning from appearing in the console? 因此,如果我没有记错的话,那是Spring的内部问题,因此我无法做任何事情来阻止警告出现在控制台中吗?

As an option you can disable logging for this particular ReleaseStrategyFactoryBean 作为选项,您可以禁用此特定ReleaseStrategyFactoryBean的日志记录

It can be done via project.properties or local.properties. 可以通过project.properties或local.properties完成。

Depending on the Hybris version you are running you should use either: 根据您所运行的Hybris版本,您应该使用以下任一方法:

log4j.logger.org.springframework.integration.config.ReleaseStrategyFactoryBean=off

or for Hybris 6.XXX please reffer to this article: 或适用于Hybris 6.XXX,请参考以下文章:

https://help.hybris.com/6.1.0/hcd/42d818c7bac44eed9ab01757472b9dbc.html https://help.hybris.com/6.1.0/hcd/42d818c7bac44eed9ab01757472b9dbc.html

And example is following: 下面是示例:

log4j2.logger.hmc.name = de.hybris.platform.servicelayer.hmc
log4j2.logger.hmc.level = warn
log4j2.logger.hmc.appenderRef.stdout.ref = STDOUT

It's an issue with your code. 这是您的代码的问题。

From the Jira issue : https://jira.spring.io/browse/INT-3298 从吉拉问题: https : //jira.spring.io/browse/INT-3298

The ReleaseStrategyFactoryBean should emit a WARN log if there is a ref attribute and no method attribute is found, and no annotated method is found. 如果存在ref属性且未找到方法属性,也未找到带注释的方法,则ReleaseStrategyFactoryBean应发出WARN日志。 Currently, it silently falls back to using the SequenceSizeReleaseStrategy. 当前,它默默地退回到使用SequenceSizeReleaseStrategy。

In 4.0, we could make this fatal. 在4.0中,我们可以使之致命。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM