When using ElasticSearch for centralized logging, all logback output will go to the stdout so that Logstash or Fluentd will pick it up and inject into ElasticSearch for indexing. In the production logback.xml in externalized config folder, there is a template with fixed columns to assist log injection. Everything works except Java stacktrace as it contains multiple lines and all injectors are handle single line only.
To make multiple line stacktrace into a single line, we have manipulated the logback template a bit to concat the stacktrace.
Here is an exmaple of the logback.xml and this should only be used on environment with centralized logging. If you want to look at the logs in file or from the console, use the logback.xml in the resources folder.