Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/add-7.10.0 #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,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.9.0](./tomcat/7.9.0/docker), [7.10.0](./tomcat/7.10.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.
22 changes: 22 additions & 0 deletions tomcat/7.10/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Pull upstream CamundaBPM Tomcat image
FROM camunda/camunda-bpm-platform:tomcat-7.10.0

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.7.jar

# Add logback configuration
RUN mkdir /camunda/conf/logback
COPY docker/camunda/conf/logback/logback.xml /camunda/conf/logback/logback.xml

# Overwrite global logging configuration for tomcat
COPY docker/camunda/conf/logging.properties /camunda/conf/logging.properties

# Copy Jar for logging
COPY docker/camunda/lib/ /camunda/lib/

# Overwrite setenv.sh with additional CLASSPATH config that exposes the libraries at tomcat startup
COPY docker/camunda/bin/setenv.sh /camunda/bin/setenv.sh


262 changes: 262 additions & 0 deletions tomcat/7.10/docker/README.md

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions tomcat/7.10/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: '3.2'

services:
camunda:
build: .
environment:
- JAVA_OPTS=-Djava.security.egd=file:/dev/./urandom -Duser.timezone=America/Montreal
ports:
- "8080:8080"
networks:
- mynetwork

networks:
mynetwork:
driver: bridge
4 changes: 4 additions & 0 deletions tomcat/7.10/docker/docker/camunda/bin/setenv.sh
Original file line number Diff line number Diff line change
@@ -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/
71 changes: 71 additions & 0 deletions tomcat/7.10/docker/docker/camunda/conf/logback/logback.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<configuration debug="false" scan="true" scanPeriod="30 seconds" >

<!-- For java.util.logging bridging; important for Camunda! -->
<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
<resetJUL>true</resetJUL>
</contextListener>

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<!-- encoders are assigned the type
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
<encoder>
<pattern>%d{HH:mm:ss.SSS} -- [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>

<appender name="json" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="net.logstash.logback.encoder.LogstashEncoder">
<if condition='${PRETTY_JSON_LOG}'>
<then>
<jsonGeneratorDecorator class="net.logstash.logback.decorate.PrettyPrintingJsonGeneratorDecorator"/>
</then>
</if>
</encoder>
</appender>

<!-- camunda -->
<!-- <logger name="org.camunda" level="info"/> -->

<!-- common dependencies -->
<!-- <logger name="org.apache.ibatis" level="info" /> -->
<!-- <logger name="javax.activation" level="info" /> -->
<!-- <logger name="org.springframework" level="info" /> -->
<!-- <logger name="org.apache.catalina" level="info" /> -->


<!-- <logger name="org.apache.jasper.servlet.TldScanner" level="debug"/> -->

<!-- avoid many log entries from failing jobs -->
<!-- <logger name="org.camunda.bpm.engine.jobexecutor" level="off" /> -->
<!-- <logger name="org.camunda.bpm.engine.context" level="off" /> -->


<!--
<logger name="org.camunda.bpm.engine.impl.persistence.entity" level="debug" />
<logger name="org.camunda.bpm.engine.history" level="debug" />
<logger name="org.camunda.bpm.engine.bpmn.parser" level="debug" />
<logger name="org.camunda.bpm.engine.bpmn.behavior" level="debug" />
<logger name="org.camunda.bpm.engine.cmmn.transformer" level="debug" />
<logger name="org.camunda.bpm.engine.cmmn.behavior" level="debug" />
<logger name="org.camunda.bpm.engine.cmmn.operation" level="debug" />
<logger name="org.camunda.bpm.engine.cmd" level="debug" />
<logger name="org.camunda.bpm.engine.persistence" level="debug" />
<logger name="org.camunda.bpm.engine.tx" level="debug" />
<logger name="org.camunda.bpm.engine.cfg" level="debug" />
<logger name="org.camunda.bpm.engine.jobexecutor" level="debug" />
<logger name="org.camunda.bpm.engine.context" level="debug" />
<logger name="org.camunda.bpm.engine.core" level="debug" />
<logger name="org.camunda.bpm.engine.pvm" level="debug" />
<logger name="org.camunda.bpm.engine.metrics" level="debug" />
<logger name="org.camunda.bpm.engine.util" level="debug" />
<logger name="org.camunda.bpm.application" level="debug" />
<logger name="org.camunda.bpm.container" level="debug" />
-->


<root level="info">
<!-- <appender-ref ref="STDOUT" /> -->
<appender-ref ref="json" />
</root>

</configuration>
1 change: 1 addition & 0 deletions tomcat/7.10/docker/docker/camunda/conf/logging.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
handlers = org.slf4j.bridge.SLF4JBridgeHandler
Binary file not shown.
13 changes: 13 additions & 0 deletions tomcat/7.10/json-logging-dependency-package/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.gradle
build/
target/
bin/
.settings
.sts*

.vscode/
.classpath
.project

.idea/
.mvn/wrapper/maven-wrapper.jar
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/

import java.net.*;
import java.io.*;
import java.nio.channels.*;
import java.util.Properties;

public class MavenWrapperDownloader {

/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL =
"https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.0/maven-wrapper-0.4.0.jar";

/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
* use instead of the default one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
".mvn/wrapper/maven-wrapper.properties";

/**
* Path where the maven-wrapper.jar will be saved to.
*/
private static final String MAVEN_WRAPPER_JAR_PATH =
".mvn/wrapper/maven-wrapper.jar";

/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";

public static void main(String args[]) {
System.out.println("- Downloader started");
File baseDirectory = new File(args[0]);
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());

// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
String url = DEFAULT_DOWNLOAD_URL;
if(mavenWrapperPropertyFile.exists()) {
FileInputStream mavenWrapperPropertyFileInputStream = null;
try {
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
} catch (IOException e) {
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
} finally {
try {
if(mavenWrapperPropertyFileInputStream != null) {
mavenWrapperPropertyFileInputStream.close();
}
} catch (IOException e) {
// Ignore ...
}
}
}
System.out.println("- Downloading from: : " + url);

File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
if(!outputFile.getParentFile().exists()) {
if(!outputFile.getParentFile().mkdirs()) {
System.out.println(
"- ERROR creating output direcrory '" + outputFile.getParentFile().getAbsolutePath() + "'");
}
}
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
try {
downloadFileFromURL(url, outputFile);
System.out.println("Done");
System.exit(0);
} catch (Throwable e) {
System.out.println("- Error downloading");
e.printStackTrace();
System.exit(1);
}
}

private static void downloadFileFromURL(String urlString, File destination) throws Exception {
URL website = new URL(urlString);
ReadableByteChannel rbc;
rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream(destination);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
rbc.close();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.2/apache-maven-3.5.2-bin.zip
Loading