I just started working on a legacy code that uses log4j 1.2.x The log works fine as is. It outputs the logs as String and the appenders work fine. However there is a need for us to change the output to JSON. I have tried changing the Layout to JSONTemplate and JSONTemplate layout, none of them gave the desired result.
Upgrading the version is not an option at the moment.
This is the current appender as configured at the moment
<appender name="consoleAppender" class="org.apache.log4j.ConsoleAppender">
<param name="Threshold" value="DEBUG" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %-5p:%t %c{4} %l - %m%n" />
</layout>
</appender>
Can someone please point me to what I need to change to make this work.
Thank you
I have tried changing the Layout to JSONTemplate and JSONTemplate layout, none of them gave the desired result.