Prevent an out of heap space when returning a large log message