How would I configure the JBoss log system to use a custom log4j layout like log4j-json or a custom JUL formatter like logstash-util-formatter?
Edit: it looks like custom formatters are available in WildFly 8 and they are coming in EAP 6.3.
In the meantime, I think I have these options which involve bypassing JBoss logging:
jboss-deployment-structure.xml
to block EAP's log libraries and use something like logback with a JSON encoder like this.Either way, I would only get JSON logging for the deployment itself, not for datasources and container startup. Is there another option which would allow all logging to be in JSON format?
It's not possible in JBoss AS 7.x or JBoss EAP 6.2. As you said though it is available in WildFly 8.0.0.Final as a custom-formatter
and will be available in JBoss EAP 6.3.
Actually it is possible, but you'd lose the ability to do runtime changes to the logging configuration. You could remove the logging subsystem and purely use the logging.properties configuration. I'd probably not suggest that unless you desperately need to use the formatter and can't wait for EAP 6.3 or use WildFly.