Skip to content

Commit 915c1d5

Browse files
Merge pull request #2425 from sajinieKavindya/master
Update warn log for better clarity
2 parents 3208371 + c46bb13 commit 915c1d5

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

modules/core/src/main/java/org/apache/synapse/endpoints/EndpointDefinition.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,13 +226,19 @@ public long evaluateDynamicEndpointTimeout(MessageContext synCtx) {
226226
if (stringValue != null) {
227227
timeoutMilliSeconds = Long.parseLong(stringValue.trim());
228228
} else {
229-
log.warn("Error while evaluating dynamic endpoint timeout expression." +
230-
"Synapse global timeout is taken as effective timeout.");
229+
log.warn("Error while evaluating dynamic endpoint timeout expression: "
230+
+ dynamicTimeout.getExpression()
231+
+ (this.leafEndpoint != null && this.leafEndpoint.getName() != null ? " in endpoint: '"
232+
+ this.leafEndpoint.getName() + "'" : " defined in an anonymous endpoint")
233+
+ ". Using the Synapse global timeout: " + effectiveTimeout + " as the effective timeout.");
231234
timeoutMilliSeconds = effectiveTimeout;
232235
}
233236
} catch (NumberFormatException e) {
234-
log.warn("Error while evaluating dynamic endpoint timeout expression." +
235-
"Synapse global timeout is taken as effective timeout.");
237+
log.warn("Error while evaluating dynamic endpoint timeout expression: " + dynamicTimeout.getExpression()
238+
+ (this.leafEndpoint != null && this.leafEndpoint.getName() != null ? " in endpoint: '"
239+
+ this.leafEndpoint.getName() + "'" : " defined in an anonymous endpoint")
240+
+ ". Using the Synapse global timeout: " + effectiveTimeout + " as the effective timeout. "
241+
+ "Error: " + e.getMessage());
236242
timeoutMilliSeconds = effectiveTimeout;
237243
}
238244
if (timeoutMilliSeconds > effectiveTimeout) {

0 commit comments

Comments
 (0)