Developer Jahia 8

Display line break on datadog

Question

In our Jahia 8 environment, \n is printed instead of an actual line break.

Answer

On Datadog we can read that we need to escape line break in event's text to work (\n -> \\n). 

So instead of using 

logger.info(stopWatch.prettyPrint()) 

You should better use this

logger.info(stopWatch.prettyPrint().replaceAll("\n", "\\n")