diff --git a/README.md b/README.md index 9949aa0..95cf479 100644 --- a/README.md +++ b/README.md @@ -13,3 +13,4 @@ Patterns for enabling JSON Logging on the Tomcat distribution of Camunda BPM Pla | Version | Description | | ------- | ----------- | | [7.9.0](./tomcat/7.9.0/docker) | Docker base image for pulling into other projects or use as a `docker run` command. Modifies Tomcat logging for usage with Logback, SLFJ4, and JSON logging using logstash-logback-encoder. +| [7.12.0](./tomcat/7.12.0/docker) | Docker base image for pulling into other projects or use as a `docker run` command. Modifies Tomcat logging for usage with Logback, SLFJ4, and JSON logging using logstash-logback-encoder. diff --git a/tomcat/7.12.0/Dockerfile b/tomcat/7.12.0/Dockerfile new file mode 100644 index 0000000..693a16c --- /dev/null +++ b/tomcat/7.12.0/Dockerfile @@ -0,0 +1,21 @@ +FROM camunda/camunda-bpm-platform:tomcat-7.12.0 + +RUN rm -rf /camunda/webapps/camunda-invoice + +ENV PRETTY_JSON_LOG=false + +# Remove the slf4j-jdj14 bridge library that is packaged with CamundaBPM tomcat distribution +RUN rm -rf /camunda/lib/slf4j-jdk14-1.7.26.jar + +# Add logback configuration +RUN mkdir /camunda/conf/logback +COPY docker/conf/logback/logback.xml /camunda/conf/logback/logback.xml + +# Overwrite global logging configuration for tomcat +COPY docker/conf/logging.properties /camunda/conf/logging.properties + +# Copy Jar for logging +COPY docker/lib/ /camunda/lib/ + +# Overwrite setenv.sh with additional CLASSPATH config that exposes the libraries at tomcat startup +COPY docker/bin/setenv.sh /camunda/bin/setenv.sh diff --git a/tomcat/7.12.0/docker-compose.yml b/tomcat/7.12.0/docker-compose.yml new file mode 100644 index 0000000..43d17cf --- /dev/null +++ b/tomcat/7.12.0/docker-compose.yml @@ -0,0 +1,9 @@ +version: "3" + +services: + camunda: + environment: + - PRETTY_JSON_LOG=true + build: . + ports: + - "18180:8080" diff --git a/tomcat/7.12.0/docker/bin/setenv.sh b/tomcat/7.12.0/docker/bin/setenv.sh new file mode 100644 index 0000000..90ef3fa --- /dev/null +++ b/tomcat/7.12.0/docker/bin/setenv.sh @@ -0,0 +1,4 @@ +#export CATALINA_OPTS="-Xmx512m -XX:MaxPermSize=256m -XX:PermSize=256m" + +# Sets the initial classpath to have the needed JUL->SLF4J jars + the logstash/Logback libraries +CLASSPATH=$CATALINA_HOME/lib/camunda-json-logging-tomcat-${CAMUNDA_VERSION}.jar:$CATALINA_HOME/conf/logback/ diff --git a/tomcat/7.12.0/docker/conf/logback/logback.xml b/tomcat/7.12.0/docker/conf/logback/logback.xml new file mode 100644 index 0000000..db39846 --- /dev/null +++ b/tomcat/7.12.0/docker/conf/logback/logback.xml @@ -0,0 +1,71 @@ + + + + + true + + + + + + %d{HH:mm:ss.SSS} -- [%thread] %-5level %logger{36} - %msg%n + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tomcat/7.12.0/docker/conf/logging.properties b/tomcat/7.12.0/docker/conf/logging.properties new file mode 100644 index 0000000..60e2845 --- /dev/null +++ b/tomcat/7.12.0/docker/conf/logging.properties @@ -0,0 +1 @@ +#handlers = org.slf4j.bridge.SLF4JBridgeHandler diff --git a/tomcat/7.12.0/docker/lib/camunda-json-logging-tomcat-7.9.0.jar b/tomcat/7.12.0/docker/lib/camunda-json-logging-tomcat-7.9.0.jar new file mode 100644 index 0000000..ebf3261 Binary files /dev/null and b/tomcat/7.12.0/docker/lib/camunda-json-logging-tomcat-7.9.0.jar differ