Merge remote-tracking branch 'origin/jetty-9.4.x'

This commit is contained in:
Jan Bartel 2016-10-11 18:00:12 +11:00
commit 6489d7fd23
49 changed files with 284 additions and 205 deletions

View File

@ -329,7 +329,7 @@
<arguments> <arguments>
<argument>jetty.home=${assembly-directory}</argument> <argument>jetty.home=${assembly-directory}</argument>
<argument>jetty.base=${assembly-directory}</argument> <argument>jetty.base=${assembly-directory}</argument>
<argument>--add-to-start=deploy,websocket,ext,resources,jsp,jstl,http</argument> <argument>--add-to-start=server,deploy,websocket,ext,resources,jsp,jstl,http</argument>
</arguments> </arguments>
</configuration> </configuration>
<goals> <goals>

View File

@ -5,23 +5,14 @@ Control GCloud API classpath
3rdparty 3rdparty
gcloud gcloud
[files]
basehome:modules/gcloud/gcloud.xml|etc/gcloud.xml
[lib] [lib]
lib/gcloud/*.jar lib/gcloud/*.jar
[xml]
etc/gcloud.xml
[license] [license]
GCloudDatastore is an open source project hosted on Github and released under the Apache 2.0 license. GCloudDatastore is an open source project hosted on Github and released under the Apache 2.0 license.
https://github.com/GoogleCloudPlatform/gcloud-java https://github.com/GoogleCloudPlatform/gcloud-java
http://www.apache.org/licenses/LICENSE-2.0.html http://www.apache.org/licenses/LICENSE-2.0.html
[ini-template] [ini-template]
## Configure the jars and packages exposed or hidden from webapps by comma separated ## Hide the gcloud libraries from deployed webapps
## list of classnames, package names or file URIs (See ClasspathPattern) jetty.webapp.addServerClasses,=file:${jetty.base}/lib/gcloud/
## Eg. to hide all gcloud dependencies other than the com.google.guava package:
## Default is all jars in lib/gcloud are hidden
# gcloud.addServerClasses=file:${jetty.base}/lib/gcloud,-com.google.guava.

View File

@ -12,7 +12,18 @@
<Arg> <Arg>
<Ref refid="Server"/> <Ref refid="Server"/>
</Arg> </Arg>
<Set name="workerName"><Property name="jetty.sessionIdManager.workerName"><Default>node<Env name="JETTY_WORKER_INSTANCE" default="0"/></Default></Property></Set> <Set name="workerName">
<Property name="jetty.sessionIdManager.workerName">
<Default>node<Env name="JETTY_WORKER_INSTANCE">
<Default>
<Env name="GAE_MODULE_INSTANCE">
<Default>0</Default>
</Env>
</Default>
</Env>
</Default>
</Property>
</Set>
<!-- ===================================================================== --> <!-- ===================================================================== -->
<!-- Configure a session housekeeper to help with scavenging --> <!-- Configure a session housekeeper to help with scavenging -->

View File

@ -17,7 +17,7 @@ setting JVM arguments (eg -Xmx )
# -XX:+CMSClassUnloadingEnabled # -XX:+CMSClassUnloadingEnabled
# -XX:+UseCMSCompactAtFullCollection # -XX:+UseCMSCompactAtFullCollection
# -XX:CMSInitiatingOccupancyFraction=80 # -XX:CMSInitiatingOccupancyFraction=80
# -verbose:gc # -internal:gc
# -XX:+PrintGCDateStamps # -XX:+PrintGCDateStamps
# -XX:+PrintGCTimeStamps # -XX:+PrintGCTimeStamps
# -XX:+PrintGCDetails # -XX:+PrintGCDetails

View File

@ -336,9 +336,9 @@ public class DefaultSessionIdManager extends AbstractLifeCycle implements Sessio
{ {
String inst = System.getenv("JETTY_WORKER_INSTANCE"); String inst = System.getenv("JETTY_WORKER_INSTANCE");
_workerName = "node"+ (inst==null?"0":inst); _workerName = "node"+ (inst==null?"0":inst);
LOG.warn("No workerName configured for DefaultSessionIdManager, using {}",_workerName);
} }
LOG.info("DefaultSessionIdManager workerName={}",_workerName);
_workerAttr=(_workerName!=null && _workerName.startsWith("$"))?_workerName.substring(1):null; _workerAttr=(_workerName!=null && _workerName.startsWith("$"))?_workerName.substring(1):null;
if (_houseKeeper == null) if (_houseKeeper == null)

View File

@ -50,11 +50,10 @@ public class BaseBuilder
* *
* @param module * @param module
* the module to add * the module to add
* @return true if module was added, false if module was not added * @return The ini file if module was added, null if module was not added.
* (because that module already exists)
* @throws IOException if unable to add the module * @throws IOException if unable to add the module
*/ */
public boolean addModule(Module module) throws IOException; public String addModule(Module module) throws IOException;
} }
private static final String EXITING_LICENSE_NOT_ACKNOWLEDGED = "Exiting: license not acknowledged!"; private static final String EXITING_LICENSE_NOT_ACKNOWLEDGED = "Exiting: license not acknowledged!";
@ -181,7 +180,6 @@ public class BaseBuilder
if (!newly_added.isEmpty()) if (!newly_added.isEmpty())
{ {
if (Files.exists(startini) && Files.exists(startd)) if (Files.exists(startini) && Files.exists(startd))
StartLog.warn("Use both %s and %s is deprecated",getBaseHome().toShortForm(startd),getBaseHome().toShortForm(startini)); StartLog.warn("Use both %s and %s is deprecated",getBaseHome().toShortForm(startd),getBaseHome().toShortForm(startini));
@ -189,6 +187,7 @@ public class BaseBuilder
builder.set(useStartD?new StartDirBuilder(this):new StartIniBuilder(this)); builder.set(useStartD?new StartDirBuilder(this):new StartIniBuilder(this));
newly_added.stream().map(n->modules.get(n)).forEach(module -> newly_added.stream().map(n->modules.get(n)).forEach(module ->
{ {
String ini=null;
try try
{ {
if (module.isSkipFilesValidation()) if (module.isSkipFilesValidation())
@ -197,8 +196,13 @@ public class BaseBuilder
} }
else else
{ {
if (builder.get().addModule(module)) // if (explictly added and ini file modified)
if (startArgs.getStartModules().contains(module.getName()))
{
ini=builder.get().addModule(module);
if (ini!=null)
modified.set(true); modified.set(true);
}
for (String file : module.getFiles()) for (String file : module.getFiles())
files.add(new FileArg(module,startArgs.getProperties().expand(file))); files.add(new FileArg(module,startArgs.getProperties().expand(file)));
} }
@ -207,6 +211,26 @@ public class BaseBuilder
{ {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
if (module.isDynamic())
{
for (String s:module.getEnableSources())
StartLog.info("%-15s %s",module.getName(),s);
}
else if (module.isTransitive())
{
if (module.hasIniTemplate())
StartLog.info("%-15s transitively enabled, ini template available with --add-to-start=%s",
module.getName(),
module.getName());
else
StartLog.info("%-15s transitively enabled",module.getName());
}
else
StartLog.info("%-15s initialized in %s",
module.getName(),
ini);
}); });
} }

View File

@ -158,6 +158,8 @@ public class Modules implements Iterable<Module>
index=""; index="";
name=""; name="";
} }
if (module.isTransitive() && module.hasIniTemplate())
System.out.printf(" init template available with --add-to-start=%s%n",module.getName());
} }
} }
@ -312,9 +314,6 @@ public class Modules implements Iterable<Module>
m.expandProperties(_args.getProperties()); m.expandProperties(_args.getProperties());
} }
} }
else if (module.isTransitive() && module.hasIniTemplate())
newlyEnabled.add(module.getName());
// Process module dependencies (always processed as may be dynamic) // Process module dependencies (always processed as may be dynamic)
for(String dependsOn:module.getDepends()) for(String dependsOn:module.getDepends())
@ -351,7 +350,7 @@ public class Modules implements Iterable<Module>
// Is there an obvious default? // Is there an obvious default?
Optional<Module> dftProvider = providers.stream().filter(m->m.getName().equals(dependsOn)).findFirst(); Optional<Module> dftProvider = providers.stream().filter(m->m.getName().equals(dependsOn)).findFirst();
if (dftProvider.isPresent()) if (dftProvider.isPresent())
enable(newlyEnabled,dftProvider.get(),"default provider of "+dependsOn+" for "+module.getName(),true); enable(newlyEnabled,dftProvider.get(),"transitive provider of "+dependsOn+" for "+module.getName(),true);
else if (StartLog.isDebugEnabled()) else if (StartLog.isDebugEnabled())
StartLog.debug("Module %s requires %s from one of %s",module,dependsOn,providers); StartLog.debug("Module %s requires %s from one of %s",module,dependsOn,providers);
} }

View File

@ -364,7 +364,7 @@ public class StartArgs
} }
else else
{ {
System.out.printf(" %s = %s%n",key,properties.expand(prop.value)); System.out.printf(" %s = %s%n",key,prop.value);
if (StartLog.isDebugEnabled()) if (StartLog.isDebugEnabled())
{ {
System.out.printf(" origin: %s%n",prop.origin); System.out.printf(" origin: %s%n",prop.origin);
@ -372,7 +372,7 @@ public class StartArgs
{ {
prop = prop.overrides; prop = prop.overrides;
System.out.printf(" (overrides)%n"); System.out.printf(" (overrides)%n");
System.out.printf(" %s = %s%n",key,properties.expand(prop.value)); System.out.printf(" %s = %s%n",key,prop.value);
System.out.printf(" origin: %s%n",prop.origin); System.out.printf(" origin: %s%n",prop.origin);
} }
} }
@ -398,7 +398,7 @@ public class StartArgs
for (String key : sortedKeys) for (String key : sortedKeys)
{ {
String value = System.getProperty(key); String value = System.getProperty(key);
System.out.printf(" %s = %s%n",key,properties.expand(value)); System.out.printf(" %s = %s%n",key,value);
} }
} }
@ -949,7 +949,7 @@ public class StartArgs
// Module Management // Module Management
if ("--list-modules".equals(arg)) if ("--list-modules".equals(arg))
{ {
listModules = Collections.singletonList("-verbose"); listModules = Collections.singletonList("-internal");
run = false; run = false;
return; return;
} }
@ -1050,13 +1050,33 @@ public class StartArgs
} }
// Is this a raw property declaration? // Is this a raw property declaration?
int idx = arg.indexOf('='); int equals = arg.indexOf('=');
if (idx >= 0) if (equals >= 0)
{ {
String key = arg.substring(0,idx); String key = arg.substring(0,equals);
String value = arg.substring(idx + 1); String value = arg.substring(equals + 1);
if (replaceProps) if (key.endsWith("+"))
{
key = key.substring(0,key.length()-1);
String orig = getProperties().getString(key);
if (orig != null && !orig.isEmpty())
{
value=orig+value;
source=propertySource.get(key)+","+source;
}
}
else if (key.endsWith(","))
{
key = key.substring(0,key.length()-1);
String orig = getProperties().getString(key);
if (orig != null && !orig.isEmpty())
{
value=value.isEmpty()?orig:(orig+","+value);
source=propertySource.get(key)+","+source;
}
}
else if (replaceProps)
{ {
if (propertySource.containsKey(key)) if (propertySource.containsKey(key))
{ {
@ -1065,17 +1085,6 @@ public class StartArgs
propertySource.put(key,source); propertySource.put(key,source);
} }
if ("OPTION".equals(key) || "OPTIONS".equals(key))
{
StringBuilder warn = new StringBuilder();
warn.append("The behavior of the argument ");
warn.append(arg).append(" (seen in ").append(source);
warn.append(") has changed, and is now considered a normal property. ");
warn.append(key).append(" no longer controls what libraries are on your classpath,");
warn.append(" use --module instead. See --help for details.");
StartLog.warn(warn.toString());
}
setProperty(key,value,source,replaceProps); setProperty(key,value,source,replaceProps);
return; return;
} }
@ -1184,7 +1193,9 @@ public class StartArgs
return; return;
} }
if (replaceProp || (!properties.containsKey(key))) if (value==null || value.isEmpty())
properties.remove(key,value,source);
else if (replaceProp || (!properties.containsKey(key)))
{ {
properties.setProperty(key,value,source); properties.setProperty(key,value,source);
if(key.equals("java.version")) if(key.equals("java.version"))

View File

@ -50,7 +50,7 @@ public class StartDirBuilder implements BaseBuilder.Config
} }
@Override @Override
public boolean addModule(Module module) throws IOException public String addModule(Module module) throws IOException
{ {
if (module.isDynamic()) if (module.isDynamic())
{ {
@ -59,28 +59,20 @@ public class StartDirBuilder implements BaseBuilder.Config
// warn // warn
StartLog.warn("%-15s not adding [ini-template] from dynamic module",module.getName()); StartLog.warn("%-15s not adding [ini-template] from dynamic module",module.getName());
} }
return false; return null;
}
String mode = "";
if (module.isTransitive())
{
mode = "(transitively) ";
} }
if (module.hasIniTemplate() || !module.isTransitive()) if (module.hasIniTemplate() || !module.isTransitive())
{ {
// Create start.d/{name}.ini // Create start.d/{name}.ini
Path ini = startDir.resolve(module.getName() + ".ini"); Path ini = startDir.resolve(module.getName() + ".ini");
StartLog.info("%-15s initialised %sin %s",module.getName(),mode,baseHome.toShortForm(ini));
try (BufferedWriter writer = Files.newBufferedWriter(ini,StandardCharsets.UTF_8,StandardOpenOption.CREATE,StandardOpenOption.TRUNCATE_EXISTING)) try (BufferedWriter writer = Files.newBufferedWriter(ini,StandardCharsets.UTF_8,StandardOpenOption.CREATE,StandardOpenOption.TRUNCATE_EXISTING))
{ {
module.writeIniSection(writer); module.writeIniSection(writer);
} }
return true; return baseHome.toShortForm(ini);
} }
return false; return null;
} }
} }

View File

@ -21,7 +21,6 @@ package org.eclipse.jetty.start.builders;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.BufferedWriter; import java.io.BufferedWriter;
import java.io.IOException; import java.io.IOException;
import java.io.PrintWriter;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
@ -86,13 +85,13 @@ public class StartIniBuilder implements BaseBuilder.Config
} }
@Override @Override
public boolean addModule(Module module) throws IOException public String addModule(Module module) throws IOException
{ {
if (modulesPresent.contains(module.getName())) if (modulesPresent.contains(module.getName()))
{ {
StartLog.info("%-15s already initialised in %s",module.getName(),baseHome.toShortForm(startIni)); StartLog.info("%-15s already initialised in %s",module.getName(),baseHome.toShortForm(startIni));
// skip, already present // skip, already present
return false; return null;
} }
if (module.isDynamic()) if (module.isDynamic())
@ -102,27 +101,19 @@ public class StartIniBuilder implements BaseBuilder.Config
// warn // warn
StartLog.warn("%-15s not adding [ini-template] from dynamic module",module.getName()); StartLog.warn("%-15s not adding [ini-template] from dynamic module",module.getName());
} }
return false; return null;
}
String mode = "";
if (module.isTransitive())
{
mode = "(transitively) ";
} }
if (module.hasIniTemplate() || !module.isTransitive()) if (module.hasIniTemplate() || !module.isTransitive())
{ {
StartLog.info("%-15s initialised %sin %s",module.getName(),mode,baseHome.toShortForm(startIni));
// Append to start.ini // Append to start.ini
try (BufferedWriter writer = Files.newBufferedWriter(startIni,StandardCharsets.UTF_8,StandardOpenOption.APPEND,StandardOpenOption.CREATE)) try (BufferedWriter writer = Files.newBufferedWriter(startIni,StandardCharsets.UTF_8,StandardOpenOption.APPEND,StandardOpenOption.CREATE))
{ {
module.writeIniSection(writer); module.writeIniSection(writer);
} }
return true; return baseHome.toShortForm(startIni);
} }
return false; return null;
} }
} }

View File

@ -147,6 +147,15 @@ Startup / Shutdown Command Line:
Properties: Properties:
name=value
Set a property that can be expanded in XML files with the <Property> element.
name+=value
Add to an existing property.
name,=value
Add to an existing property as a comma separated list.
STOP.HOST=[string] STOP.HOST=[string]
The host to use to stop the running Jetty server (defaults to 127.0.0.1) The host to use to stop the running Jetty server (defaults to 127.0.0.1)
Required along with STOP.PORT if you want to use the --stop option above. Required along with STOP.PORT if you want to use the --stop option above.

View File

@ -12,3 +12,5 @@ PROP|main.prop=value0
PROP|port=9090 PROP|port=9090
PROP|other=value PROP|other=value
PROP|jetty.http.port=9090 PROP|jetty.http.port=9090
PROP|add=beginningmiddleend
PROP|list=one,two,three

View File

@ -1,2 +1,8 @@
other=value other=value
port=9090 port=9090
add+=beginning
add+=middle
add+=end
list,=one
list,=two
list,=three

View File

@ -14,7 +14,7 @@ LIB|${jetty.home}/lib/extra/extra1.jar
# The Properties we expect (order is irrelevant) # The Properties we expect (order is irrelevant)
PROP|extra.prop=value0 PROP|extra.prop=value0
PROP|main.prop=valueT PROP|main.prop=value0
PROP|optional.prop=value0 PROP|optional.prop=value0
# Files / Directories to create # Files / Directories to create

View File

@ -14,12 +14,11 @@ LIB|${jetty.home}/lib/extra/extra1.jar
# The Properties we expect (order is irrelevant) # The Properties we expect (order is irrelevant)
PROP|extra.prop=value0 PROP|extra.prop=value0
PROP|main.prop=valueT PROP|main.prop=value0
PROP|optional.prop=value0 PROP|optional.prop=value0
# Files / Directories to create # Files / Directories to create
EXISTS|maindir/ EXISTS|maindir/
EXISTS|start.d/main.ini
EXISTS|start.d/extra.ini EXISTS|start.d/extra.ini
EXISTS|start.d/optional.ini EXISTS|start.d/optional.ini

View File

@ -14,12 +14,11 @@ LIB|${jetty.home}/lib/extra/extra1.jar
# The Properties we expect (order is irrelevant) # The Properties we expect (order is irrelevant)
PROP|extra.prop=value0 PROP|extra.prop=value0
PROP|main.prop=valueT PROP|main.prop=value0
PROP|optional.prop=value0 PROP|optional.prop=value0
# Files / Directories to create # Files / Directories to create
EXISTS|maindir/ EXISTS|maindir/
EXISTS|start.d/ EXISTS|start.d/
EXISTS|start.d/main.ini
EXISTS|start.d/extra.ini EXISTS|start.d/extra.ini
EXISTS|start.d/optional.ini EXISTS|start.d/optional.ini

View File

@ -4,5 +4,8 @@ etc/t.xml
[optional] [optional]
main main
[ini]
transient.option=transient
[ini-template] [ini-template]
transient.option=transient transient.option=transient

View File

@ -5,7 +5,7 @@ To receive jetty logs the jetty-slf4j and slf4j-jcl must also be enabled.
[tags] [tags]
logging logging
jcl jcl
verbose internal
[depends] [depends]

View File

@ -1,12 +1,11 @@
[description] [description]
Provides a Java Commons Logging implementation that logs to the SLF4J API. Provides a Java Commons Logging (JCL) to SLF4J logging bridge.
Requires another module that provides and SLF4J implementation.
[tags] [tags]
logging logging
jcl jcl
slf4j slf4j
verbose internal
[depends] [depends]
slf4j-api slf4j-api

View File

@ -1,12 +0,0 @@
[description]
Provides a Jetty Logging implementation that logs to the Java Util Logging API.
Requires another module that provides a Java Util Logging implementation.
[tags]
logging
[provide]
logging
[exec]
-Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.JavaUtilLog

View File

@ -1,12 +0,0 @@
[description]
Provides a Jetty Logging implementation that logs to the log4j API.
Uses the slf4j mechanism as an intermediary
Requires another module that provides an log4j implementation.
[tags]
logging
log4j
[depend]
jetty-slf4j
slf4j-log4j

View File

@ -1,13 +0,0 @@
[description]
Provides a Jetty Logging implementation that logs to the log4j API.
Uses the slf4j and log4j v1.2 mechanisms as intermediaries.
Requires another module that provides an log4j2 implementation.
[tags]
logging
log4j2
log4j
[depend]
jetty-slf4j
slf4j-log4j2

View File

@ -1,10 +0,0 @@
[description]
Provides a Jetty Logging implementation that logs to logback.
Uses the slf4j API as an intermediary
[tags]
logging
[depend]
jetty-slf4j
slf4j-logback

View File

@ -1,16 +0,0 @@
[description]
Enables the Jetty Logging implementation and installs a template
configuration in ${jetty.base} resources/jetty-logging.properties.
[tags]
logging
[depends]
resources
[provide]
logging
[files]
basehome:modules/jetty-logging/jetty-logging.properties|resources/jetty-logging.properties

View File

@ -1,17 +0,0 @@
[description]
Provides a Jetty Logging implementation that logs to the SLF4J API.
Requires another module that provides and SLF4J implementation.
[tags]
logging
slf4j
[depend]
slf4j-api
slf4j-impl
[provide]
logging
[exec]
-Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.Slf4jLog

View File

@ -5,7 +5,7 @@ To receive jetty logs enable the jetty-slf4j and slf4j-log4j modules.
[tags] [tags]
logging logging
log4j log4j
verbose internal
[depends] [depends]
resources resources

View File

@ -1,13 +1,11 @@
[description] [description]
Provides a Log4j v1.2 implementation that logs to the Log4j v2 API. Provides a Log4j v1.2 to Log4j v2 logging bridge.
Requires another module that provides and Log4j v2 implementation.
To receive jetty logs the jetty-slf4j and slf4j-log4j must also be enabled.
[tags] [tags]
logging logging
log4j2 log4j2
log4j log4j
verbose internal
[depends] [depends]
log4j2-api log4j2-api

View File

@ -1,13 +1,11 @@
[description] [description]
Provides the Log4j v2 API Provides the Log4j v2 API
Requires another module that provides an Log4j v2 implementation.
To receive jetty logs enable the jetty-slf4j, slf4j-log4j and log4j-log4j2 modules.
[tags] [tags]
logging logging
log4j2 log4j2
log4j log4j
verbose internal
[files] [files]
maven://org.apache.logging.log4j/log4j-api/${log4j2.version}|lib/log4j/log4j-api-${log4j2.version}.jar maven://org.apache.logging.log4j/log4j-api/${log4j2.version}|lib/log4j/log4j-api-${log4j2.version}.jar

View File

@ -6,7 +6,7 @@ To receive jetty logs enable the jetty-slf4j, slf4j-log4j and log4j-log4j2 modul
logging logging
log4j2 log4j2
log4j log4j
verbose internal
[depends] [depends]
log4j2-api log4j2-api

View File

@ -1,14 +1,12 @@
[description] [description]
Provides a Log4j v2 implementation that logs to the SLF4J API. Provides a Log4j v2 to SLF4J logging bridge.
Requires another module that provides and SLF4J implementation.
To receive jetty logs enable the jetty-slf4j module.
[tags] [tags]
logging logging
log4j2 log4j2
log4j log4j
slf4j slf4j
verbose internal
[depends] [depends]
log4j2-api log4j2-api

View File

@ -1,10 +1,10 @@
[description] [description]
Provides the logback core implementation, used by slf4j-logback Provides the logback core implementation
and logback-access and logback-access
[tags] [tags]
logging logging
verbose internal
[files] [files]
maven://ch.qos.logback/logback-core/${logback.version}|lib/logback/logback-core-${logback.version}.jar maven://ch.qos.logback/logback-core/${logback.version}|lib/logback/logback-core-${logback.version}.jar

View File

@ -0,0 +1,20 @@
[description]
Configure jetty logging to use Java Commons Logging (jcl)
Uses SLF4j as a logging bridge.
[tags]
logging
[depends]
slf4j-jcl
jcl-impl
[provide]
logging
[exec]
-Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.Slf4jLog
[ini-template]
## Hide logging classes from deployed webapps
jetty.webapp.addServerClasses,=file:${jetty.base}/lib/slf4j/,file:${jetty.base}/lib/jul

View File

@ -0,0 +1,15 @@
[description]
Configure jetty logging mechanism.
Provides a ${jetty.base}/resources/jetty-logging.properties.
[tags]
logging
[depends]
resources
[provide]
logging
[files]
basehome:modules/logging-jetty/jetty-logging.properties|resources/jetty-logging.properties

View File

@ -0,0 +1,19 @@
[description]
Configure jetty logging to use Java Util Logging (jul)
Uses SLF4j as a logging bridge.
[tags]
logging
[depends]
slf4j-jul
[provide]
logging
[exec]
-Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.Slf4jLog
[ini-template]
## Hide logging classes from deployed webapps
jetty.webapp.addServerClasses,=file:${jetty.base}/lib/slf4j/

View File

@ -0,0 +1,20 @@
[description]
Configure jetty logging to use Log4j Logging
Uses SLF4j as a logging bridge.
[tags]
logging
[depends]
slf4j-log4j
log4j-impl
[provide]
logging
[exec]
-Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.Slf4jLog
[ini-template]
## Hide logging classes from deployed webapps
jetty.webapp.addServerClasses,=file:${jetty.base}/lib/slf4j/,file:${jetty.base}/lib/log4j/

View File

@ -0,0 +1,20 @@
[description]
Configure jetty logging to use log4j version 2
Uses SLF4j as a logging bridge.
[tags]
logging
[depends]
slf4j-log4j2
log4j2-impl
[provide]
logging
[exec]
-Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.Slf4jLog
[ini-template]
## Hide logging classes from deployed webapps
jetty.webapp.addServerClasses,=file:${jetty.base}/lib/slf4j/,file:${jetty.base}/lib/log4j/

View File

@ -0,0 +1,20 @@
[description]
Configure jetty logging to use Logback Logging.
Uses SLF4j as a logging bridge.
[tags]
logging
[depends]
slf4j-logback
logback-impl
[provide]
logging
[exec]
-Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.Slf4jLog
[ini-template]
## Hide logging classes from deployed webapps
jetty.webapp.addServerClasses,=file:${jetty.base}/lib/slf4j/,file:${jetty.base}/lib/logback

View File

@ -0,0 +1,19 @@
[description]
Configure jetty logging to use slf4j.
Any slf4j-impl implementation is used
[tags]
logging
[depends]
slf4j-impl
[provide]
logging
[exec]
-Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.Slf4jLog
[ini-template]
## Hide logging classes from deployed webapps
jetty.webapp.addServerClasses,=file:${jetty.base}/lib/slf4j/

View File

@ -2,15 +2,20 @@
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd"> <!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd">
<Configure id="Server" class="org.eclipse.jetty.server.Server"> <Configure id="Server" class="org.eclipse.jetty.server.Server">
<Call class="org.eclipse.jetty.webapp.WebAppContext" name="addSystemClasses">
<Arg><Ref refid="Server"/></Arg>
<Arg>
<Call class="org.eclipse.jetty.util.StringUtil" name="csvSplit">
<Arg><Property name="jetty.webapp.addSystemClasses"/></Arg>
</Call>
</Arg>
</Call>
<!-- ===================================================================== -->
<!-- Configure a GCloud classpath exposed to webapps -->
<!-- ===================================================================== -->
<Call class="org.eclipse.jetty.webapp.WebAppContext" name="addServerClasses"> <Call class="org.eclipse.jetty.webapp.WebAppContext" name="addServerClasses">
<Arg><Ref refid="Server"/></Arg> <Arg><Ref refid="Server"/></Arg>
<Arg> <Arg>
<Call class="org.eclipse.jetty.util.StringUtil" name="csvSplit"> <Call class="org.eclipse.jetty.util.StringUtil" name="csvSplit">
<Arg><Property name="gcloud.addServerClasses"><Default>file:<Property name="jetty.base"/>/lib/gcloud</Default></Property></Arg> <Arg><Property name="jetty.webapp.addServerClasses"/></Arg>
</Call> </Call>
</Arg> </Arg>
</Call> </Call>

View File

@ -5,7 +5,7 @@ otherwise a noop implementation is used.
[tags] [tags]
logging logging
slf4j slf4j
verbose internal
[files] [files]
maven://org.slf4j/slf4j-api/${slf4j.version}|lib/slf4j/slf4j-api-${slf4j.version}.jar maven://org.slf4j/slf4j-api/${slf4j.version}|lib/slf4j/slf4j-api-${slf4j.version}.jar

View File

@ -5,7 +5,7 @@ To receive jetty logs enable the jetty-slf4j module.
[tags] [tags]
logging logging
slf4j slf4j
verbose internal
[depend] [depend]
slf4j-api slf4j-api

View File

@ -1,13 +1,11 @@
[description] [description]
Provides a SLF4J implementation that logs to the Java Commons Logging API. Provides a SLF4J to Java Commons Logging (JCL) logging bridge.
Requires another module that provides an JCL implementation.
To receive jetty logs enable the jetty-slf4j module.
[tags] [tags]
logging logging
jcl jcl
slf4j slf4j
verbose internal
[depend] [depend]
slf4j-api slf4j-api

View File

@ -1,11 +1,10 @@
[description] [description]
Provides a SLF4J implementation that logs to the Java Util Logging API. Provides a SLF4J to Java Util Logging (JUL) logging bridge.
To receive jetty logs enable the jetty-slf4j module.
[tags] [tags]
logging logging
slf4j slf4j
verbose internal
[depend] [depend]
slf4j-api slf4j-api

View File

@ -1,13 +1,11 @@
[description] [description]
Provides a SLF4J implementation that logs to the Log4j v1.2 API. Provides a SLF4J to the Log4j v1.2 API logging bridge.
Requires another module that provides a Log4j implementation.
To receive jetty logs enable the jetty-slf4j module.
[tags] [tags]
logging logging
log4j log4j
slf4j slf4j
verbose internal
[depend] [depend]
slf4j-api slf4j-api

View File

@ -1,14 +1,12 @@
[description] [description]
Provides a SLF4J implementation that logs to the Log4j v2 API. Provides a SLF4J to Log4j v2 logging bridge.
Requires another module that provides a Log4j2 implementation.
To receive jetty logs enable the jetty-slf4j2 module.
[tags] [tags]
logging logging
log4j2 log4j2
log4j log4j
slf4j slf4j
verbose internal
[depend] [depend]
slf4j-api slf4j-api

View File

@ -1,15 +1,14 @@
[description] [description]
Provides a SLF4J implementation that logs to Logback classic Provides a SLF4J to Logback logging bridge.
To receive jetty logs enable the jetty-slf4j module.
[tags] [tags]
logging logging
slf4j slf4j
verbose internal
[depend] [depend]
slf4j-api slf4j-api
logback-core logback-impl
resources resources
[provide] [provide]

View File

@ -12,7 +12,6 @@ etc/stderrout-logging.xml
logs/ logs/
[lib] [lib]
lib/logging/**.jar
resources/ resources/
[ini-template] [ini-template]

View File

@ -24,5 +24,5 @@ lib/jetty-webapp-${jetty.version}.jar
## + a directory of jars,resource or classes e.g. 'file:${jetty.base}/resources' ## + a directory of jars,resource or classes e.g. 'file:${jetty.base}/resources'
## + A pattern preceeded with a '-' is an exclusion, all other patterns are inclusions ## + A pattern preceeded with a '-' is an exclusion, all other patterns are inclusions
## ##
#jetty.webapp.addSystemClasses= jetty.webapp.addSystemClasses,=
#jetty.webapp.addServerClasses= jetty.webapp.addServerClasses,=