...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
List<User> userList = reply.result().getResults(); userList.size() < 3 ? logger.debug("Existing users: {}", userList) : logger.debug("Number of existing users: {}", userList.size()); if (LOGGER.isTraceEnabled()) { printFirstNElementsFromList(10, userList); } ... private void printFirstNElementsFromList(int numberElements, List listForPrint) { .... } |
Big objects
Big objects should not be logged "as-is". If there's a need to log such an object, consider creating local wrapper, redefining toString() method within it, so it only contains most useful data from the object (id, referenced id's, maybe state)
...