ARTEMIS-224 add logmanager to JVM args
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/5de97a39 Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/5de97a39 Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/5de97a39 Branch: refs/heads/master Commit: 5de97a39a0338fca4d917dbfc6d7fd7a1535a9c8 Parents: 0a3ec0f Author: jbertram <[email protected]> Authored: Thu Sep 17 15:21:15 2015 -0500 Committer: Clebert Suconic <[email protected]> Committed: Fri Sep 18 15:08:09 2015 -0400 ---------------------------------------------------------------------- .../activemq/artemis/cli/commands/Create.java | 20 ++++++++++++++++++++ .../artemis/cli/commands/etc/artemis.profile | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/5de97a39/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java ---------------------------------------------------------------------- diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java index 8a2d60e..0a430a3 100644 --- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java +++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java @@ -21,6 +21,7 @@ import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileOutputStream; +import java.io.FilenameFilter; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; @@ -526,6 +527,8 @@ public class Create extends InputAbstract { File dataFolder = new File(directory, "data"); dataFolder.mkdirs(); + filters.put("${logmanager}", getLogManager()); + if (javaOptions == null || javaOptions.length() == 0) { javaOptions = ""; } @@ -616,6 +619,23 @@ public class Create extends InputAbstract { return null; } + private String getLogManager() throws IOException { + String logManager = ""; + File dir = new File(path(getHome().toString(), false) + "/lib"); + + File[] matches = dir.listFiles(new FilenameFilter() { + public boolean accept(File dir, String name) { + return name.startsWith("jboss-logmanager") && name.endsWith(".jar"); + } + }); + + if (matches != null && matches.length > 0) { + logManager = matches[0].getName(); + } + + return logManager; + } + /** * It will create the jms configurations */ http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/5de97a39/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/artemis.profile ---------------------------------------------------------------------- diff --git a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/artemis.profile b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/artemis.profile index ff31642..2a51e2a 100644 --- a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/artemis.profile +++ b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/artemis.profile @@ -23,7 +23,7 @@ ARTEMIS_HOME='${artemis.home}' # Java Opts -JAVA_ARGS="-XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -Xms512M -Xmx1024M ${java-opts}" +JAVA_ARGS="-XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -Xms512M -Xmx1024M -Xbootclasspath/a:$ARTEMIS_HOME/lib/${logmanager} -Djava.util.logging.manager=org.jboss.logmanager.LogManager ${java-opts}" # Debug args: Uncomment to enable debug
