Chad,

I tried it manually to see what dependencies we'd need/want and how to
set it up. To get the logs in JSON (not pretty and not using Jackson)
I only needed to add logback-json-classic and logback-json-core to
both lib/ and lib/bootstrap. I'd be interested to hear what others in
the community think, but since the two JARs together are under 10KB, I
think it's reasonable to add them (but keep logback.xml the way it
is). We can point to a blog post (one of ours or [1] ) or Wiki to
illustrate how to set it up for JSON output.

Bringing in logback-jackson is IMO not an option as it has Jackson as
a dependency and then all NARs would use the version we provide, when
they might want to bring-their-own-Jackson so to speak.

Feel free to write up an improvement Jira to add support for JSON
output in NiFi logs if you like, we could continue the discussion over
there.

Regards,
Matt

[1] https://mathieularose.com/logback-json/

On Wed, Feb 3, 2021 at 11:13 PM Chad Zobrisky <czobri...@gmail.com> wrote:
>
> Hello,
>
> I was looking at getting the log output from logback in JSON to support
> some downstream systems for logging. What is the best way to do this?
>
> I know logback supports it via some other dependencies, in groupId
> ch.qos.logback.contrib, logback-json-classic and logback-jackson, but those
> are not in Nifi's current build.
>
> Would this be something to add in for the flexibility to have log output in
> JSON, or is there a better path forward?
>
> Thanks,
> Chad

Reply via email to