LogsJsonViewer by Robin S

Formats JSON data in ProcessLogger for improved readability.

Logs JSON Viewer

Formats JSON data in ProcessLogger for improved readability.

Because log files can only contain strings, it's a common practice to use json_encode() to convert an array to a string when you want to save the data to a log file.

But the resulting JSON is not as readable as it could be when viewing the log in ProcessLogger. The Logs JSON Viewer module uses the json-viewer library to improve the readability of JSON data in ProcessLogger and add some useful features.

Before:

ljv-1

After:

ljv-2

Configuration


You can set the config options for json-viewer in a textarea field. See the json-viewer readme for information about the options.

There is also an option to set the width of the column that contains the JSON data. This setting exists because otherwise the column jumps around in an inconsistent and distracting way when changing from log to log or between paginations.

Features


You can switch the view of the JSON data between formatted and unformatted using the toggle button at the bottom of the data.

The viewer has a number of useful features such as:

  • Progressively expand or collapse levels in the data.
  • View the count of child items and the data type of each item.
  • Search for a string within the data.
  • Copy all or part of the data to the clipboard (requires the HTTPS protocol).

Install and use modules at your own risk. Always have a site and database backup before installing new modules.

Latest news

  • ProcessWire Weekly #548
    In the 548th issue of ProcessWire Weekly we're going to check out a couple of new third party modules, introduce the latest ProcessWire core updates, and more. Read on!
    Weekly.pw / 9 November 2024
  • Custom Fields Module
    This week we look at a new ProFields module named Custom Fields. This module provides a way to rapidly build out ProcessWire fields that contain any number of subfields/properties within them.
    Blog / 30 August 2024
  • Subscribe to weekly ProcessWire news

“We chose ProcessWire because of its excellent architecture, modular extensibility and the internal API. The CMS offers the necessary flexibility and performance for such a complex website like superbude.de. ProcessWire offers options that are only available for larger systems, such as Drupal, and allows a much slimmer development process.” —xport communication GmbH