Re: [Chainsaw] JSON Support

2021-06-19 Thread Robert Middleton
I've added some basic JSON support to Chainsaw: https://github.com/apache/logging-chainsaw/pull/9 It is a little funny to work with though, because of how Chainsaw works it is tightly tied to Log4j1 messages, so all we're really doing is extracting the parts that we care about and putting it into t

Re: [Chainsaw] JSON Support

2021-06-19 Thread Volkan Yazıcı
For the records, JsonTemplateLayout also quotes all escape characters, including CR and LF characters, in every(!) string value. For instance, the following test succeeds: String eventTemplate = writeJson(asMap( "epochSecs", asMap( "$resolver", "exception", "field", "st

Re: [Chainsaw] JSON Support

2021-06-18 Thread Robert Middleton
On Fri, Jun 18, 2021 at 8:40 AM Volkan Yazıcı wrote: > > ECS , the > default schema shipped with JsonTemplateLayout, is nowadays the de facto > structure for JSON formatted logs. Since Chainsaw will parse logs emitted > mostly from Lo

Re: [Chainsaw] JSON Support

2021-06-18 Thread Scott Deboy
Arbitrary text formats are already supported in Chainsaw -files can be tailed locally or remotely (ssh) via a receiver that leverages Commons VFS: https://logging.apache.org/chainsaw/2.x/apidocs/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiver.html The receiver supports the common pattern

Re: [Chainsaw] JSON Support

2021-06-18 Thread Ralph Goers
> On Jun 18, 2021, at 10:40 AM, Matt Sicker wrote: > > A couple other common log collection setups I've come across over time: > > * Logging to stdout/stderr in a standard format, then use a log > collection API from your orchestration engine (common in the > Kubernetes world to avoid logging

Re: [Chainsaw] JSON Support

2021-06-18 Thread Matt Sicker
A couple other common log collection setups I've come across over time: * Logging to stdout/stderr in a standard format, then use a log collection API from your orchestration engine (common in the Kubernetes world to avoid logging to a file). * Logging to a log file as normal, but running a log fo

Re: [Chainsaw] JSON Support

2021-06-18 Thread Volkan Yazıcı
ECS , the default schema shipped with JsonTemplateLayout, is nowadays the de facto structure for JSON formatted logs. Since Chainsaw will parse logs emitted mostly from Log4j, it is wise to make it fully compliant with the one we ship

Re: [Chainsaw] JSON Support

2021-06-17 Thread Ralph Goers
You should look at one of the formats that JsonTemplateLayout supports out of the box. Ralph > On Jun 17, 2021, at 6:09 PM, Robert Middleton wrote: > > I'm looking into adding some more modern JSON support into Chainsaw > for processing log statements from applications, but I'm not sure what >

[Chainsaw] JSON Support

2021-06-17 Thread Robert Middleton
I'm looking into adding some more modern JSON support into Chainsaw for processing log statements from applications, but I'm not sure what the best format for that is at the moment. Is there a standard JSON format that would make the most sense to use? Currently, I'm thinking that this would make