Try to store your custom JSON layout on the classpath and reference it from the log4j config:
<Appenders>
<Console name="Console" target="SYSTEM_OUT" follow="true">
<JsonTemplateLayout eventTemplateUri="classpath:MyCustomLayout.json"/>
</Console>
</Appenders>