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

Should log JSON in newline-delimited format

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PUP 6.2.0
    • Component/s: Docs
    • Template:
    • Epic Link:
    • Team:
      Coremunity
    • Sprint:
      Platform Core KANBAN
    • Release Notes:
      Enhancement
    • Release Notes Summary:
      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.
    • QA Risk Assessment:
      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

            jsd-sla-details-panel

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support