We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0802581 commit ac581beCopy full SHA for ac581be
spring-core/src/main/java/org/springframework/core/log/LogFormatUtils.java
@@ -22,6 +22,7 @@
22
import org.apache.commons.logging.Log;
23
24
import org.springframework.lang.Nullable;
25
+import org.springframework.util.ObjectUtils;
26
27
/**
28
* Utility methods for formatting and logging messages.
@@ -71,10 +72,10 @@ public static String formatValue(
71
72
}
73
String result;
74
try {
- result = value.toString();
75
+ result = ObjectUtils.nullSafeToString(value);
76
77
catch (Throwable ex) {
- result = ex.toString();
78
+ result = ObjectUtils.nullSafeToString(ex);
79
80
if (maxLength != -1) {
81
result = (result.length() > maxLength ? result.substring(0, maxLength) + " (truncated)..." : result);
0 commit comments