Search code examples
loggingpuppet

Is there a way to force a newline in Puppet log messages?


When I output an error message in puppet, such as with Puppet.err (from a Ruby module), it is displayed in the Puppet Enterprise console log in a difficult to read fashion, because in HTML, newlines are ignored. If I try to insert line breaks (HTML <br/> tags) before each newline, Puppet escapes them by turning the angle brackets into HTML entities.

Is there a way to tell Puppet to include newlines or not escape the br tags? Perhaps a place in the puppet source code that I can change to get this behavior? For example, I call Puppet.err. Where is this function defined?


Solution

  • The logging methods are created in a bit of a mystical fashion.

    For what it's worth, I disbelieve that core Puppet is escaping the HTML, it's more likely a commodity feature of the Console itself.

    You could try and hook your reports up to Puppet Explorer or puppet-board, see if you fare better with either of those. But I'm not sure how well this will play with PE.