Change the log level when the rest entity is changed (#13250)

* Change the log level when the rest entity is changed

Signed-off-by: crazyhzm <crazyhzm@gmail.com>

* check if debug level is enabled

Signed-off-by: crazyhzm <crazyhzm@gmail.com>

---------

Signed-off-by: crazyhzm <crazyhzm@gmail.com>
This commit is contained in:
huazhongming 2023-11-01 19:52:20 +08:00 committed by GitHub
parent aa631cd362
commit 34fda039b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -124,9 +124,10 @@ public class DubboContainerResponseContextImpl implements SuspendableContainerRe
@Override
public void setEntity(Object entity) {
//if (entity != null) logger.info("*** setEntity(Object) " + entity.toString());
if (entity != null && jaxrsResponse.getEntity() != null) {
logger.info("Dubbo container response context filter set entity ,before entity is: " + jaxrsResponse.getEntity() + "and after entity is: " + entity);
if (logger.isDebugEnabled()) {
logger.debug("Dubbo container response context filter set entity ,before entity is: " + jaxrsResponse.getEntity() + "and after entity is: " + entity);
}
}
jaxrsResponse.setEntity(entity);
@ -138,9 +139,10 @@ public class DubboContainerResponseContextImpl implements SuspendableContainerRe
@Override
public void setEntity(Object entity, Annotation[] annotations, MediaType mediaType) {
//if (entity != null) logger.info("*** setEntity(Object, Annotation[], MediaType) " + entity.toString() + ", " + mediaType);
if (entity != null && jaxrsResponse.getEntity() != null) {
logger.info("Dubbo container response context filter set entity ,before entity is: " + jaxrsResponse.getEntity() + "and after entity is: " + entity);
if (logger.isDebugEnabled()) {
logger.debug("Dubbo container response context filter set entity ,before entity is: " + jaxrsResponse.getEntity() + "and after entity is: " + entity);
}
}
jaxrsResponse.setEntity(entity);
jaxrsResponse.setAnnotations(annotations);