Skip to content

Commit

Permalink
More verbose logging with instructions for users.
Browse files Browse the repository at this point in the history
  • Loading branch information
rgallardo-netflix committed Oct 30, 2023
1 parent ffd39f0 commit dbe9b5c
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -494,8 +494,13 @@ private static <T> void warnWhenTooMany(Map<T, Integer> counters, T countKey, in
currentCount >= limit &&
(currentCount % limit == 0 )) {

LOG.warn("Too many {} objects are being created. Please review the calling code to prevent memory leaks. Stack trace for debugging follows:",
objectDescription.get(), new Throwable());
LOG.warn(
"Too many {} objects are being created ({} so far).\n" +
"Please review the calling code to prevent memory leaks.\n" +
"Normal usage for ConfigProxyFactory is to create singletons via your DI mechanism.\n" +
"For special use cases that *require* creating multiple instances you can tune reporting\n" +
"by setting the `{}` config key to a higher threshold.\nStack trace for debugging follows:",
objectDescription.get(), currentCount, EXCESSIVE_PROXIES_LIMIT, new Throwable());
}
}

Expand Down

0 comments on commit dbe9b5c

Please sign in to comment.