Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds a JSON formatter for the OTP kernel logger #2

Open
wants to merge 3 commits into
base: openriak-3.4
Choose a base branch
from

Conversation

tburghart
Copy link
Member

This is a standalone formatter to write properly-formed JSON records to log files.

While tested against Riak logs, it should work in any OTP application.

The formatter is thoroughly documented in the repo here

Important Note: When built with OTP-27+, the formatter uses the json module for unicode escaping. On prior versions, it uses a less efficient but wholly self-contained mechanism. The macro USE_OTP_JSON can be defined at compile time to force use of of an existing json:encode/1 function if you know it is present in your application.

* Fixes badmatch with naked filename.
* Fixes formatting that put commas around some colons.
* Always uses this module's encoder for everything but binary escaping.
* Allows inter-line delimiter to be configured.
* Allows all top-level output keys to be filtered, not just metadata.
* Handles format rewriting internally to exclude unused cases.
* Expands test cases with verification on OTP 27+.

wday-contrib 2077
* Handle pretty much any log event gracefully, no matter how misformed.
* Fixed a unicode control character encoding bug that was just dumb.
* All unicode, all the time.
* Give reports with `args` and `format` fields special handling.
* More eunit tests.

wday-contrib 2077
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant