Logging in JSON format

Can you or anybody else give any more detail on the steps needed to create a new appender and hook it up? I figure each sentence from someone who has any idea what they’re talking about will save me 8 hours of floundering.

I was able to implement JSON logs for Lucee’s tomcat by following this ( Enable JSON Logging in Tomcat 8 with Log4j2) but now I’m trying to move on to the proper Lucee logs.

FYI, I’m doing this so that I can set up a filebeat to shoot logs to Elastic Stack, and I figure it will be easier if all the files start out as JSON (no parsing necessary).

Update: I wonder if it’s possible to use the classes that I used for tomcat. Maybe some way to specify org.apache.logging.log4j.core.layout.JsonLayout in lucee-web.xml? I don’t know what that syntax would look like, though.

Pseudo-XML:

		<logger
			appender="console"
			appender-arguments="path:{lucee-config}/logs/exception.log"
			layout="org.apache.logging.log4j.core.layout.JsonLayout"
			level="info"
			name="exception"
		/>