TwP / logging

A flexible logging library for use in Ruby programs based on the design of Java's log4j library.
https://rubygems.org/gems/logging
MIT License
530 stars 101 forks source link

Extend JSON layout with prefix #198

Closed lzap closed 1 year ago

lzap commented 6 years ago

Hello. Syslog implementation rsyslog has a module named mmjsonparse which is able to parse JSON data prefixed with special cookie. It can be set to arbitrary value, but de-facto standard is @cee: which stands for CEE initiative by MITRE and project Lumberjack hosted on Fedora.

While it is possible to set cookie-less parsing using this statement in rsyslog configuration:

action(type="mmjsonparse" cookie="")

this must be done globally as mmjsonparse cannot be used in if-statement, therefore use of cookie prefix is unavoidable. This patch adds an extra option for JSON layout called "prefix" and if present, all messages are prefixed with an arbitrary string. The prefix is ignored for YAML where it's not relevant.

https://www.rsyslog.com/doc/master/configuration/modules/mmjsonparse.html

lzap commented 6 years ago

There appear to be problem with jruby on travis.

ares commented 6 years ago

LGTM

lzap commented 1 year ago

Closing, feel free to take it from here if you think this patch is useful. Cheers!