diff --git a/spring-cloud-function-context/src/main/java/org/springframework/cloud/function/json/JacksonMapper.java b/spring-cloud-function-context/src/main/java/org/springframework/cloud/function/json/JacksonMapper.java index fe501485a..2288aca36 100644 --- a/spring-cloud-function-context/src/main/java/org/springframework/cloud/function/json/JacksonMapper.java +++ b/spring-cloud-function-context/src/main/java/org/springframework/cloud/function/json/JacksonMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,9 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.type.TypeFactory; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + /** * @author Dave Syer @@ -32,6 +35,8 @@ import com.fasterxml.jackson.databind.type.TypeFactory; */ public class JacksonMapper extends JsonMapper { + private static Log logger = LogFactory.getLog(JacksonMapper.class); + private final ObjectMapper mapper; public JacksonMapper(ObjectMapper mapper) { @@ -75,7 +80,9 @@ public class JacksonMapper extends JsonMapper { jsonBytes = this.mapper.writeValueAsBytes(value); } catch (Exception e) { - //ignore and let other converters have a chance + if (logger.isTraceEnabled()) { + logger.trace("Failed to writeValueAsBytes: " + value, e); + } } } return jsonBytes;