Repository: activemq-artemis Updated Branches: refs/heads/master 0711b35e3 -> a915e8b90
ARTEMIS-1150 Fixing logging with spaces Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/a915e8b9 Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/a915e8b9 Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/a915e8b9 Branch: refs/heads/master Commit: a915e8b904068a4cd94957867dcad244363329b9 Parents: 0711b35 Author: Clebert Suconic <[email protected]> Authored: Fri May 5 16:00:56 2017 -0400 Committer: Clebert Suconic <[email protected]> Committed: Fri May 5 16:08:30 2017 -0400 ---------------------------------------------------------------------- .../activemq/artemis/cli/commands/Create.java | 35 +++++++++----------- .../activemq/artemis/cli/commands/bin/artemis | 7 ++-- .../artemis/cli/commands/bin/artemis.cmd | 2 +- .../artemis/cli/commands/etc/artemis.profile | 5 +++ .../cli/commands/etc/artemis.profile.cmd | 5 +++ 5 files changed, 31 insertions(+), 23 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a915e8b9/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 feb23dd..783ed50 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 @@ -584,12 +584,13 @@ public class Create extends InputAbstract { applyAddressesAndQueues(filters); if (home != null) { - filters.put("${home}", path(home, false)); + filters.put("${home}", path(home)); } - filters.put("${artemis.home}", path(getHome().toString(), false)); - filters.put("${artemis.instance}", path(directory, false)); + filters.put("${artemis.home}", path(getHome().toString())); + filters.put("${artemis.instance}", path(directory)); + filters.put("${artemis.instance.uri}", directory.toURI().toString()); filters.put("${artemis.instance.name}", directory.getName()); - filters.put("${java.home}", path(System.getProperty("java.home"), false)); + filters.put("${java.home}", path(System.getProperty("java.home"))); new File(directory, "bin").mkdirs(); new File(directory, "etc").mkdirs(); @@ -688,7 +689,7 @@ public class Create extends InputAbstract { context.out.println(""); context.out.println("You can now start the broker by executing: "); context.out.println(""); - context.out.println(String.format(" \"%s\" run", path(new File(directory, "bin/artemis"), true))); + context.out.println(String.format(" \"%s\" run", path(new File(directory, "bin/artemis")))); File service = new File(directory, BIN_ARTEMIS_SERVICE); context.out.println(""); @@ -696,7 +697,7 @@ public class Create extends InputAbstract { if (!IS_WINDOWS || IS_CYGWIN) { context.out.println("Or you can run the broker in the background using:"); context.out.println(""); - context.out.println(String.format(" \"%s\" start", path(service, true))); + context.out.println(String.format(" \"%s\" start", path(service))); context.out.println(""); } @@ -704,14 +705,14 @@ public class Create extends InputAbstract { service = new File(directory, BIN_ARTEMIS_SERVICE_EXE); context.out.println("Or you can setup the broker as Windows service and run it in the background:"); context.out.println(""); - context.out.println(String.format(" \"%s\" install", path(service, true))); - context.out.println(String.format(" \"%s\" start", path(service, true))); + context.out.println(String.format(" \"%s\" install", path(service))); + context.out.println(String.format(" \"%s\" start", path(service))); context.out.println(""); context.out.println(" To stop the windows service:"); - context.out.println(String.format(" \"%s\" stop", path(service, true))); + context.out.println(String.format(" \"%s\" stop", path(service))); context.out.println(""); context.out.println(" To uninstall the windows service"); - context.out.println(String.format(" \"%s\" uninstall", path(service, true))); + context.out.println(String.format(" \"%s\" uninstall", path(service))); } return null; @@ -752,7 +753,7 @@ public class Create extends InputAbstract { private String getLogManager() throws IOException { String logManager = ""; - File dir = new File(path(getHome().toString(), false) + "/lib"); + File dir = new File(path(getHome().toString()) + "/lib"); File[] matches = dir.listFiles(new FilenameFilter() { @Override @@ -866,16 +867,12 @@ public class Create extends InputAbstract { } } - private String path(String value, boolean unixPaths) throws IOException { - return path(new File(value), unixPaths); + private String path(String value) throws IOException { + return path(new File(value)); } - private String path(File value, boolean unixPaths) throws IOException { - if (unixPaths && IS_CYGWIN) { - return value.getCanonicalPath(); - } else { - return value.getCanonicalPath(); - } + private String path(File value) throws IOException { + return value.getCanonicalPath(); } private void write(String source, HashMap<String, String> filters, boolean unixTarget) throws Exception { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a915e8b9/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/artemis ---------------------------------------------------------------------- diff --git a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/artemis b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/artemis index 9649744..b66141a 100755 --- a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/artemis +++ b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/artemis @@ -44,13 +44,14 @@ if [ -z "$ARTEMIS_INSTANCE" ] ; then ARTEMIS_INSTANCE=`cd "$ARTEMIS_INSTANCE/.." && pwd` fi +# Load Profile Data +. "$ARTEMIS_INSTANCE/etc/artemis.profile" + # Set Defaults Properties -ARTEMIS_LOGGING_CONF="file:$ARTEMIS_INSTANCE/etc/logging.properties" +ARTEMIS_LOGGING_CONF="$ARTEMIS_INSTANCE_URI/etc/logging.properties" ARTEMIS_DATA_DIR="$ARTEMIS_INSTANCE/data" ARTEMIS_LOG_MANAGER=org.jboss.logmanager.LogManager -# Load Profile Data -. "$ARTEMIS_INSTANCE/etc/artemis.profile" CLASSPATH="$ARTEMIS_HOME/lib/artemis-boot.jar" http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a915e8b9/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/artemis.cmd ---------------------------------------------------------------------- diff --git a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/artemis.cmd b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/artemis.cmd index abbd468..9c6fd7d 100644 --- a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/artemis.cmd +++ b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/artemis.cmd @@ -48,7 +48,7 @@ echo. :RUN_JAVA rem "Set Defaults." -set ARTEMIS_LOGGING_CONF=file:%ARTEMIS_INSTANCE%\etc\logging.properties +set ARTEMIS_LOGGING_CONF=%ARTEMIS_INSTANCE_URI%/etc/logging.properties set ARTEMIS_DATA_DIR=%ARTEMIS_INSTANCE%\data set ARTEMIS_LOG_MANAGER=org.jboss.logmanager.LogManager http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a915e8b9/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 5b44b9b..ed23e53 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 @@ -18,6 +18,11 @@ ARTEMIS_HOME='${artemis.home}' ARTEMIS_INSTANCE='${artemis.instance}' +# The logging config will need an URI +# this will be encoded in case you use spaces or special characters +# on your directory structure +ARTEMIS_INSTANCE_URI='${artemis.instance.uri}' + # Cluster Properties: Used to pass arguments to ActiveMQ Artemis which can be referenced in broker.xml #ARTEMIS_CLUSTER_PROPS="-Dactivemq.remoting.default.port=61617 -Dactivemq.remoting.amqp.port=5673 -Dactivemq.remoting.stomp.port=61614 -Dactivemq.remoting.hornetq.port=5446" http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a915e8b9/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/artemis.profile.cmd ---------------------------------------------------------------------- diff --git a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/artemis.profile.cmd b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/artemis.profile.cmd index 31cb576..fe37275 100644 --- a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/artemis.profile.cmd +++ b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/artemis.profile.cmd @@ -19,6 +19,11 @@ rem under the License. set ARTEMIS_HOME="${artemis.home}" set ARTEMIS_INSTANCE="${artemis.instance}" +rem The logging config will need an URI +rem this will be encoded in case you use spaces or special characters +rem on your directory structure +set ARTEMIS_INSTANCE_URI="${artemis.instance.uri}" + rem Cluster Properties: Used to pass arguments to ActiveMQ Artemis which can be referenced in broker.xml rem set ARTEMIS_CLUSTER_PROPS=-Dactivemq.remoting.default.port=61617 -Dactivemq.remoting.amqp.port=5673 -Dactivemq.remoting.stomp.port=61614 -Dactivemq.remoting.hornetq.port=5446
