The vom-json Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The vom-json Reference Manual

This is the vom-json Reference Manual, version 2, generated automatically by Declt version 3.0 "Montgomery Scott" on Fri Jun 26 12:35:17 2020 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

.. image:: https://travis-ci.org/fisxoj/vom-json.svg?branch=master
   :target: https://travis-ci.org/fisxoj/vom-json
   :alt: Travis CI status badge
.. image:: https://img.shields.io/badge/Contributor%20Covenant-v1.4%20adopted-ff69b4.svg
   :alt: Contributor Covenant
   :target: CODE_OF_CONDUCT.md


:Source: `https://github.com/fisxoj/vom-json `_
:Docs:  `https://fisxoj.github.io/vom-json/ `_

vom-json is a complementary library to `vom `_, which changes the logger syntax to something like `lambda-log `_ which outputs its log messages in the JSON format.  In some environments like AWS insights, this makes the log data more searchable.

You can use it two ways:

Wrap the body of your program in it using :macro:`vom-json:with-json-logging`::

  (vom-json:with-json-logging
    (vom:error "Oh noes!"))
  ;; => {"_logLevel":"error","_timestamp":"2020-05-11T18:23:58.569136Z","msg":"Oh noes!","_tags":[],"_package":"common-lisp-user"}

Enable the logger globally::

  (vom-json:enable-json-logging)

This project is extremely inspired by `log4cl-json `_.


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 vom-json

Author

Matt Novenstern <fisxoj@gmail.com>

Source Control

(:git "https://github.com/fisxoj/vom-json.git")

License

MIT

Description

A json-formatted logger for vom

Long Description

.. image:: https://travis-ci.org/fisxoj/vom-json.svg?branch=master
:target: https://travis-ci.org/fisxoj/vom-json
:alt: Travis CI status badge
.. image:: https://img.shields.io/badge/Contributor%20Covenant-v1.4%20adopted-ff69b4.svg
:alt: Contributor Covenant
:target: CODE_OF_CONDUCT.md

:Source: ‘https://github.com/fisxoj/vom-json <https://github.com/fisxoj/vom-json>‘_
:Docs: ‘https://fisxoj.github.io/vom-json/ <https://fisxoj.github.io/vom-json/>‘_

vom-json is a complementary library to ‘vom <https://github.com/orthecreedence/vom>‘_, which changes the logger syntax to something like ‘lambda-log <https://github.com/KyleRoss/node-lambda-log/>‘_ which outputs its log messages in the JSON format. In some environments like AWS insights, this makes the log data more searchable.

You can use it two ways:

Wrap the body of your program in it using :macro:‘vom-json:with-json-logging‘::

(vom-json:with-json-logging
(vom:error "Oh noes!"))
;; => {"_logLevel":"error","_timestamp":"2020-05-11T18:23:58.569136Z","msg":"Oh noes!","_tags":[],"_package":"common-lisp-user"}

Enable the logger globally::

(vom-json:enable-json-logging)

This project is extremely inspired by ‘log4cl-json <https://github.com/40ants/log4cl-json/>‘_.

Version

2

Dependencies
Source

vom-json.asd (file)

Component

vom-json.lisp (file)


Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 vom-json.asd

Location

vom-json.asd

Systems

vom-json (system)


Previous: , Up: Lisp files   [Contents][Index]

3.1.2 vom-json/vom-json.lisp

Parent

vom-json (system)

Location

vom-json.lisp

Packages

vom-json

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 vom-json

Source

vom-json.lisp (file)

Use List

common-lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Macros

Macro: with-json-logging &body BODY

Sets ‘vom <https://github.com/orthecreedence/vom>‘_’s log format to json for the body of the macro. You could, for example wrap the whole execution context of an app with this to ensure the app uses json logging but doesn’t interfere with... I dunno... another app running in the same image that you wan to use a different log format for some reason? It just seems right to include a “WITH-...“ macro in a lisp library.

Package

vom-json

Source

vom-json.lisp (file)

Macro: with-tags (&rest TAGS) &body BODY

A nestable macro to allow adding tags to log messages. Any log messages printed inside a :macro:‘with-tags‘ call should have those tags in the “tags“ array.

Package

vom-json

Source

vom-json.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

5.1.2 Functions

Function: disable-json-formatter ()

The inverse of :function:‘enable-json-formatter‘.

Package

vom-json

Source

vom-json.lisp (file)

Function: enable-json-formatter ()

Changes :variable:‘vom:*log-formatter*‘ to :function:‘json-formatter‘, preserving the current log formatter for :function:‘disable-json-formatter‘ to restore, later.

Package

vom-json

Source

vom-json.lisp (file)

Function: json-formatter FORMAT-STR LEVEL-STR PACKAGE-KEYWORD ARGS

The formatter which produces logs in json.

Has fields:

* “_logLevel“: The log level, eg. warn, info, &c.
* “msg“: The formatted message.
* “_tags“: Any tags included by :macro:‘with-tags‘ forms. * “_timestamp“: An rfc3399 timestamp.
* “_package“: The package the log message originates from.

Package

vom-json

Source

vom-json.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Special variables

Special Variable: *last-formatter*

The formatter function replaced by :function:‘enable-json-formatter‘.

Package

vom-json

Source

vom-json.lisp (file)

Special Variable: *tags*

Tags to be printed along with the message.

Package

vom-json

Source

vom-json.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L   V  
Index Entry  Section

F
File, Lisp, vom-json.asd: The vom-json․asd file
File, Lisp, vom-json/vom-json.lisp: The vom-json/vom-json․lisp file

L
Lisp File, vom-json.asd: The vom-json․asd file
Lisp File, vom-json/vom-json.lisp: The vom-json/vom-json․lisp file

V
vom-json.asd: The vom-json․asd file
vom-json/vom-json.lisp: The vom-json/vom-json․lisp file

Jump to:   F   L   V  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   D   E   F   J   M   W  
Index Entry  Section

D
disable-json-formatter: Exported functions

E
enable-json-formatter: Exported functions

F
Function, disable-json-formatter: Exported functions
Function, enable-json-formatter: Exported functions
Function, json-formatter: Exported functions

J
json-formatter: Exported functions

M
Macro, with-json-logging: Exported macros
Macro, with-tags: Exported macros

W
with-json-logging: Exported macros
with-tags: Exported macros

Jump to:   D   E   F   J   M   W  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *  
S  
Index Entry  Section

*
*last-formatter*: Internal special variables
*tags*: Internal special variables

S
Special Variable, *last-formatter*: Internal special variables
Special Variable, *tags*: Internal special variables

Jump to:   *  
S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   P   S   V  
Index Entry  Section

P
Package, vom-json: The vom-json package

S
System, vom-json: The vom-json system

V
vom-json: The vom-json system
vom-json: The vom-json package

Jump to:   P   S   V