Skip to content
Grant Carthew edited this page May 12, 2018 · 20 revisions

perj

A simple, fast JSON logger.

perj

Documentations is not complete. See the WORKLOG for more detail.

Goals

The perj project has the following goals:

  • KISS: Keep it simple smiley. ✔️
  • Designed to be integrated rather than used out of the box (DIY). ✔️
  • Cross platform (Node.js and Browser) with no platform dependencies. ✔️
  • Flexible log and additional property options. ✔️
  • Fast. ✔️
  • Feature limited. ✔️

Features

  • No dependencies.
  • Flexible log methods:
    • Log items can be any number in any order of any type.
  • The first string is nested under the 'msg' key:
    • First string includes a string argument or an Error message.
    • Additional string arguments are nested under the data key.
  • Objects are nested under the 'data' key as an object or array of objects.
  • No transports included (see primary goal).

Rational

After having some performance issues with a popular Node.js logging package I decided to switch to another logger that is advertised as blasing fast called pino. It's great and you should check it out.

There were a couple of things I found a little restrictive within the pino API. Specifically I wanted to be able to log content in any order without being tied down to a fixed argument list. I also wanted to ensure all extra log data was nested under a root property.

Using pino as a yard stick I created perj to meet my goals.