1. A system, comprising: a processor; and a memory storing a program, which, when executed on the processor, performs an operation for generating log data for a trace operation during execution of an application on the system, the operation comprising: initiating a trace operation, wherein the trace operation generates a string, wherein the trace operation specifies one or more objects to serialize and append to the string, wherein at least one object is a nested object, and wherein the trace operation recursively parses the nested object while generating the string, determining data associated with one or more of the objects to prune from the serialization based on a current prioritization level, serializing the one or more objects into the string, and upon determining that a maximum character length is exceeded while serializing at least one of the one or more objects, decreasing the current prioritization level of the object for subsequent executions of the trace operation.