From b20e2ddf18cd2ddbfa6a6e531cb44c01daab24c3 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Tue, 28 Jun 2016 13:01:16 -0700 Subject: [PATCH 1/3] Fixes #672 - Allow logging configuration announcement to be programmatically disabled --- .../java/org/eclipse/jetty/util/log/Log.java | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/log/Log.java b/jetty-util/src/main/java/org/eclipse/jetty/util/log/Log.java index 6d10772d327..65daa00035d 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/log/Log.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/log/Log.java @@ -167,13 +167,18 @@ public class Log return; __initialized = true; + Boolean announce = Boolean.parseBoolean(__props.getProperty("org.eclipse.jetty.util.log.announce", "true")); + try { Class log_class = __logClass==null?null:Loader.loadClass(Log.class, __logClass); if (LOG == null || (log_class!=null && !LOG.getClass().equals(log_class))) { LOG = (Logger)log_class.newInstance(); - LOG.debug("Logging to {} via {}", LOG, log_class.getName()); + if(announce) + { + LOG.debug("Logging to {} via {}", LOG, log_class.getName()); + } } } catch(Throwable e) @@ -182,8 +187,10 @@ public class Log initStandardLogging(e); } - if (LOG!=null) - LOG.info(String.format("Logging initialized @%dms",Uptime.getUptime())); + if (announce && LOG!=null) + { + LOG.info(String.format("Logging initialized @%dms", Uptime.getUptime())); + } } } @@ -199,7 +206,12 @@ public class Log { log_class = StdErrLog.class; LOG = new StdErrLog(); - LOG.debug("Logging to {} via {}", LOG, log_class.getName()); + + Boolean announce = Boolean.parseBoolean(__props.getProperty("org.eclipse.jetty.util.log.announce", "true")); + if(announce) + { + LOG.debug("Logging to {} via {}", LOG, log_class.getName()); + } } } @@ -322,4 +334,9 @@ public class Log { return Collections.unmodifiableMap(__loggers); } + + public static Properties getProperties() + { + return __props; + } } From 1ac16733961fb16a2bf23c40552d9c8bb338d47b Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Tue, 28 Jun 2016 13:39:28 -0700 Subject: [PATCH 2/3] Fixes #667 - Alternate `jetty.deploy.monitoredDirPath` for jetty-deploy outside of ${jetty.base} --- jetty-deploy/src/main/config/etc/jetty-deploy.xml | 9 ++++++++- jetty-deploy/src/main/config/modules/deploy.mod | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/jetty-deploy/src/main/config/etc/jetty-deploy.xml b/jetty-deploy/src/main/config/etc/jetty-deploy.xml index 4544362f2ae..bd0925348aa 100644 --- a/jetty-deploy/src/main/config/etc/jetty-deploy.xml +++ b/jetty-deploy/src/main/config/etc/jetty-deploy.xml @@ -39,7 +39,14 @@ - / + + + jetty.deploy.monitoredPath + + / + + + /etc/webdefault.xml diff --git a/jetty-deploy/src/main/config/modules/deploy.mod b/jetty-deploy/src/main/config/modules/deploy.mod index f567a2090f0..5dcaaf13071 100644 --- a/jetty-deploy/src/main/config/modules/deploy.mod +++ b/jetty-deploy/src/main/config/modules/deploy.mod @@ -17,6 +17,9 @@ etc/jetty-deploy.xml [ini-template] # Monitored directory name (relative to $jetty.base) # jetty.deploy.monitoredDir=webapps +# - OR - +# Monitored directory path (fully qualified) +# jetty.deploy.monitoredPath=/var/www/webapps # Monitored directory scan period (seconds) # jetty.deploy.scanInterval=1 From bba1c19875c0a2d653157a8a85089564e3c39da2 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Tue, 28 Jun 2016 13:44:36 -0700 Subject: [PATCH 3/3] Fixes #668 - Introduce optional `jetty.deploy.defaultsDescriptorPath` for jetty-deploy defaults descriptor outside of ${jetty.home} --- jetty-deploy/src/main/config/etc/jetty-deploy.xml | 9 ++++++++- jetty-deploy/src/main/config/modules/deploy.mod | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/jetty-deploy/src/main/config/etc/jetty-deploy.xml b/jetty-deploy/src/main/config/etc/jetty-deploy.xml index bd0925348aa..c27fb3ec2d7 100644 --- a/jetty-deploy/src/main/config/etc/jetty-deploy.xml +++ b/jetty-deploy/src/main/config/etc/jetty-deploy.xml @@ -47,7 +47,14 @@ - /etc/webdefault.xml + + + jetty.deploy.defaultsDescriptorPath + + /etc/webdefault.xml + + + diff --git a/jetty-deploy/src/main/config/modules/deploy.mod b/jetty-deploy/src/main/config/modules/deploy.mod index 5dcaaf13071..788b9e7d0ea 100644 --- a/jetty-deploy/src/main/config/modules/deploy.mod +++ b/jetty-deploy/src/main/config/modules/deploy.mod @@ -21,6 +21,9 @@ etc/jetty-deploy.xml # Monitored directory path (fully qualified) # jetty.deploy.monitoredPath=/var/www/webapps +# Defaults Descriptor for all deployed webapps +# jetty.deploy.defaultsDescriptorPath=${jetty.base}/etc/webdefault.xml + # Monitored directory scan period (seconds) # jetty.deploy.scanInterval=1