Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-8687

Should log JSON in newline-delimited format

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • PUP 6.2.0
    • Docs
    • Enhancement
    • Hide
      Puppet will log in newline-delimited JSON if the argument to the {{logdest}} setting or command line option is an absolute path and ends with the ".jsonl" extension, such as `puppet agent --logdest /var/log/puppet.jsonl`. This is preferable to the JSON format, since the generated log is not valid JSON and needs to have a closing ']' appended to make it valid.
      Show
      Puppet will log in newline-delimited JSON if the argument to the {{logdest}} setting or command line option is an absolute path and ends with the ".jsonl" extension, such as `puppet agent --logdest /var/log/puppet.jsonl`. This is preferable to the JSON format, since the generated log is not valid JSON and needs to have a closing ']' appended to make it valid.
    • Needs Assessment

    Description

      The --logdest option is described like this:

      A path ending with '.json' will receive structured output in JSON format. The log file will not have an ending ']' automatically written to it due to the appending nature of logging. It must be appended manually to make the content valid JSON.

      https://puppet.com/docs/puppet/5.5/man/agent.html

      Instead of writing out invalid JSON that must be manually accounted for, we should write out newline-delimited JSON. There are libraries that can work with this file format rather than needing to manually account for the closing ] each time you work with it.

      Attachments

        Activity

          People

            jorie Jorie Tappa
            ben.ford Ben Ford
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Zendesk Support