Hello Anudeep,

*[I am moving the conversation to the "users" mailing list. All committers
already get notified by the newly created JIRA tickets – unless they have
explicitly opted out for. I will appreciate it if you can direct your
questions to this mailing list next time.]*

Thanks so much for your kind words regarding JSON Template Layout (JTL). It
is really motivating for people who have put great effort into this
project. I am personally happy to hear that JTL turned out to be such a
perfect fit for your use case. Please don't hesitate to share your further
feedback and questions.

As I have commented in the ticket, you need to define a system property,
not a configuration file property. For instance,

java -jar app.jar -Dlog4j2.mapMessage.jsonFormatter.maxDepth=8


I don't know any other way to change read properties – others might know
more.

That said, I am also curious about your use case. That is, what is the
payload that necessitates a map serialization depth higher than 8?

Kind regards.

---------- Forwarded message ---------
From: Anudeep Nunna <anudeep.nu...@khumbusystems.com>
Date: Sun, Jan 24, 2021 at 3:46 PM
Subject: Log4j2 JSON template layout help
To: <volkan.yaz...@gmail.com>


Hi Volkan,

First off let me tell you that your JSON Template layout project was a huge
help for us in our project. We've been looking for a custom JSON layout
implementation and finally found your gem. It was a perfect fit.
Coincidentally project release and our requirement almost happened at the
same time.

While we're printing all our logs in a JSON format, we're facing issues
while writing JSON payloads which are big and nested. We're seeing this
following error

ERROR An exception occurred processing Appender ConsoleAppender
java.lang.IllegalArgumentException: maxDepth has been exceeded

I tried to override this log4j2.mapMessage.jsonFormatter.maxDepth = 12 value
in log4j2.properties, but it is of no use. we're still seeing this error. I
created a JIRA ticket <https://issues.apache.org/jira/browse/LOG4J2-3002>.
Not sure if I'm doing anything wrong but we're so close to the deadline of
going live to production. I need your guidance on this issue if this isn't
too much to ask for.
Printing flattened JSON isn't an option for me we need these payloads to be
parsed by other programs.

I'd highly appreciate it if you can point me in the right direction. Also,
tell me if you need any additional info on this issue.

Thanks in advance,
Anudeep

Reply via email to