From 2fbf46639318a6e0fe8ceb666d5f4dde09035e30 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Thu, 16 Jun 2016 20:31:52 +1000 Subject: [PATCH] Issue #644 Modules for enabling logging --- .../src/main/config/modules/server.mod | 1 + .../org/eclipse/jetty/start/BaseBuilder.java | 22 ++++--- .../java/org/eclipse/jetty/start/FileArg.java | 9 +-- .../java/org/eclipse/jetty/start/Module.java | 14 ++--- .../java/org/eclipse/jetty/start/Modules.java | 12 +++- .../fileinits/BaseHomeFileInitializer.java | 61 +++++++++++++++++++ .../resources/usecases/alternate.3.assert.txt | 2 +- .../resources/usecases/files.0.assert.txt | 2 + .../resources/usecases/files.0.prepare.txt | 1 + .../resources/usecases/files/modules/demo.mod | 3 + .../files/modules/demo/demo-config.xml | 0 .../main/config/modules/java-util-logging.mod | 8 +++ .../src/main/config/modules/log4j-log4j2.mod | 16 +++++ jetty-util/src/main/config/modules/log4j.mod | 20 ++++++ .../config/modules/log4j}/log4j.properties | 2 - .../src/main/config/modules/log4j2-api.mod | 14 +++++ .../src/main/config/modules/log4j2-core.mod | 16 +++++ .../src/main/config/modules/log4j2-slf4j.mod | 17 ++++++ .../config/modules/log4j2/log4j2.properties | 11 ++++ .../src/main/config/modules/logging.mod | 10 --- .../src/main/config/modules/slf4j-api.mod | 36 +++++++++++ .../src/main/config/modules/slf4j-log4j12.mod | 16 +++++ .../src/main/config/modules/slf4j-simple.mod | 17 ++++++ .../eclipse/jetty/util/TopologicalSort.java | 21 ++++++- .../java/org/eclipse/jetty/util/log/Log.java | 2 +- 25 files changed, 297 insertions(+), 36 deletions(-) create mode 100644 jetty-start/src/main/java/org/eclipse/jetty/start/fileinits/BaseHomeFileInitializer.java create mode 100644 jetty-start/src/test/resources/usecases/files.0.assert.txt create mode 100644 jetty-start/src/test/resources/usecases/files.0.prepare.txt create mode 100644 jetty-start/src/test/resources/usecases/files/modules/demo.mod create mode 100644 jetty-start/src/test/resources/usecases/files/modules/demo/demo-config.xml create mode 100644 jetty-util/src/main/config/modules/java-util-logging.mod create mode 100644 jetty-util/src/main/config/modules/log4j-log4j2.mod create mode 100644 jetty-util/src/main/config/modules/log4j.mod rename {jetty-home/src/main/resources/resources => jetty-util/src/main/config/modules/log4j}/log4j.properties (77%) create mode 100644 jetty-util/src/main/config/modules/log4j2-api.mod create mode 100644 jetty-util/src/main/config/modules/log4j2-core.mod create mode 100644 jetty-util/src/main/config/modules/log4j2-slf4j.mod create mode 100644 jetty-util/src/main/config/modules/log4j2/log4j2.properties create mode 100644 jetty-util/src/main/config/modules/slf4j-api.mod create mode 100644 jetty-util/src/main/config/modules/slf4j-log4j12.mod create mode 100644 jetty-util/src/main/config/modules/slf4j-simple.mod diff --git a/jetty-server/src/main/config/modules/server.mod b/jetty-server/src/main/config/modules/server.mod index fde5d631bde..896d3997d74 100644 --- a/jetty-server/src/main/config/modules/server.mod +++ b/jetty-server/src/main/config/modules/server.mod @@ -5,6 +5,7 @@ Enables the core Jetty server on the classpath. jvm ext resources +logging [lib] lib/servlet-api-3.1.jar diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/BaseBuilder.java b/jetty-start/src/main/java/org/eclipse/jetty/start/BaseBuilder.java index 0f79e04f575..ae8db8c809e 100644 --- a/jetty-start/src/main/java/org/eclipse/jetty/start/BaseBuilder.java +++ b/jetty-start/src/main/java/org/eclipse/jetty/start/BaseBuilder.java @@ -28,10 +28,10 @@ import java.util.List; import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; -import java.util.function.Consumer; import org.eclipse.jetty.start.builders.StartDirBuilder; import org.eclipse.jetty.start.builders.StartIniBuilder; +import org.eclipse.jetty.start.fileinits.BaseHomeFileInitializer; import org.eclipse.jetty.start.fileinits.MavenLocalRepoFileInitializer; import org.eclipse.jetty.start.fileinits.TestFileInitializer; import org.eclipse.jetty.start.fileinits.UriFileInitializer; @@ -71,6 +71,9 @@ public class BaseBuilder // Establish FileInitializers if (args.isTestingModeEnabled()) { + // Copy from basehome + fileInitializers.add(new BaseHomeFileInitializer(baseHome)); + // No downloads performed fileInitializers.add(new TestFileInitializer()); } @@ -90,6 +93,9 @@ public class BaseBuilder fileInitializers.add(new MavenLocalRepoFileInitializer(baseHome)); } + // Copy from basehome + fileInitializers.add(new BaseHomeFileInitializer(baseHome)); + // Normal URL downloads fileInitializers.add(new UriFileInitializer(baseHome)); } @@ -215,14 +221,12 @@ public class BaseBuilder */ private boolean processFileResource(FileArg arg, Path file) throws IOException { + // now on copy/download paths (be safe above all else) + if (!file.startsWith(baseHome.getBasePath())) + throw new IOException("For security reasons, Jetty start is unable to process maven file resource not in ${jetty.base} - " + file); + if (startArgs.isDownload() && (arg.uri != null)) { - // now on copy/download paths (be safe above all else) - if (!file.startsWith(baseHome.getBasePath())) - { - throw new IOException("For security reasons, Jetty start is unable to process maven file resource not in ${jetty.base} - " + file); - } - // make the directories in ${jetty.base} that we need boolean modified = FS.ensureDirectoryExists(file.getParent()); @@ -238,7 +242,9 @@ public class BaseBuilder } } - return false; + System.err.println("Failed to initialize: "+arg.uri+"|"+arg.location); + + return modified; } else { diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/FileArg.java b/jetty-start/src/main/java/org/eclipse/jetty/start/FileArg.java index fb1b3e7c4b1..b934649f280 100644 --- a/jetty-start/src/main/java/org/eclipse/jetty/start/FileArg.java +++ b/jetty-start/src/main/java/org/eclipse/jetty/start/FileArg.java @@ -44,10 +44,11 @@ public class FileArg final String LN = System.lineSeparator(); err.append("Unrecognized [file] argument: ").append(uriLocation); err.append(LN).append("Valid Syntaxes: "); - err.append(LN).append(" - eg: resources/"); - err.append(LN).append(" or - eg: /var/run/jetty.pid"); - err.append(LN).append(" or | - eg: http://machine/my.conf|resources/my.conf"); - err.append(LN).append(" or | - eg: http://machine/glob.dat|/opt/run/glob.dat"); + err.append(LN).append(" - eg: resources/"); + err.append(LN).append(" or - eg: /var/run/jetty.pid"); + err.append(LN).append(" or | - eg: http://machine/my.conf|resources/my.conf"); + err.append(LN).append(" or | - eg: http://machine/glob.dat|/opt/run/glob.dat"); + err.append(LN).append("Known uri schemes: http, maven, home"); throw new IllegalArgumentException(err.toString()); } if (parts.length == 2) diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/Module.java b/jetty-start/src/main/java/org/eclipse/jetty/start/Module.java index c0dd2d009d7..68c7abda387 100644 --- a/jetty-start/src/main/java/org/eclipse/jetty/start/Module.java +++ b/jetty-start/src/main/java/org/eclipse/jetty/start/Module.java @@ -402,16 +402,16 @@ public class Module public String toString() { StringBuilder str = new StringBuilder(); - str.append("Module[").append(getName()); + str.append(getName()).append('{'); if (isEnabled()) { - str.append(",enabled"); + str.append("enabled"); + if (isTransitive()) + str.append(",transitive"); } - if (isTransitive()) - { - str.append(",transitive"); - } - str.append(']'); + else if (isTransitive()) + str.append("transitive"); + str.append('}'); return str.toString(); } diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/Modules.java b/jetty-start/src/main/java/org/eclipse/jetty/start/Modules.java index 19c92057d6c..fecb64561a4 100644 --- a/jetty-start/src/main/java/org/eclipse/jetty/start/Modules.java +++ b/jetty-start/src/main/java/org/eclipse/jetty/start/Modules.java @@ -205,7 +205,15 @@ public class Modules implements Iterable module.getDepends().forEach(add); module.getOptional().forEach(add); } - sort.sort(_modules); + try + { + sort.sort(_modules); + } + catch (IllegalStateException e) + { + System.err.println(sort.dump()); + throw e; + } } public List getEnabled() @@ -251,7 +259,7 @@ public class Modules implements Iterable } } else - throw new UsageException("Capability %s already enabled by %s for %s",name,p.getName(),module.getName()); + throw new UsageException("%s provides %s, which is already provided by %s enabled in %s",module.getName(),name,p.getName(),p.getEnableSources()); } }); } diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/fileinits/BaseHomeFileInitializer.java b/jetty-start/src/main/java/org/eclipse/jetty/start/fileinits/BaseHomeFileInitializer.java new file mode 100644 index 00000000000..be67fba59a1 --- /dev/null +++ b/jetty-start/src/main/java/org/eclipse/jetty/start/fileinits/BaseHomeFileInitializer.java @@ -0,0 +1,61 @@ +// +// ======================================================================== +// Copyright (c) 1995-2016 Mort Bay Consulting Pty. Ltd. +// ------------------------------------------------------------------------ +// All rights reserved. This program and the accompanying materials +// are made available under the terms of the Eclipse Public License v1.0 +// and Apache License v2.0 which accompanies this distribution. +// +// The Eclipse Public License is available at +// http://www.eclipse.org/legal/epl-v10.html +// +// The Apache License v2.0 is available at +// http://www.opensource.org/licenses/apache2.0.php +// +// You may elect to redistribute this code under either of these licenses. +// ======================================================================== +// + +package org.eclipse.jetty.start.fileinits; + +import java.io.IOException; +import java.net.URI; +import java.nio.file.Files; +import java.nio.file.Path; + +import org.eclipse.jetty.start.BaseHome; +import org.eclipse.jetty.start.FS; +import org.eclipse.jetty.start.FileInitializer; + +/** + * Copy a file found in {@link BaseHome} from a URI of the form + * "basehome:some/path" + * {@link FileInitializer} + */ +public class BaseHomeFileInitializer implements FileInitializer +{ + private final BaseHome _basehome; + + public BaseHomeFileInitializer(BaseHome basehome) + { + _basehome=basehome; + } + + @Override + public boolean init(URI uri, Path file, String fileRef) throws IOException + { + if (!"basehome".equalsIgnoreCase(uri.getScheme()) || uri.getSchemeSpecificPart().startsWith("/")) + return false; + + Path source = _basehome.getPath(uri.getSchemeSpecificPart()); + + if (FS.exists(source) && !FS.exists(file)) + { + FS.ensureDirectoryExists(file.getParent()); + Files.copy(source,file); + return true; + } + + return false; + } +} diff --git a/jetty-start/src/test/resources/usecases/alternate.3.assert.txt b/jetty-start/src/test/resources/usecases/alternate.3.assert.txt index 6a83f84eb75..7d35fe73cdc 100644 --- a/jetty-start/src/test/resources/usecases/alternate.3.assert.txt +++ b/jetty-start/src/test/resources/usecases/alternate.3.assert.txt @@ -1,2 +1,2 @@ EX|UsageException -EX|default already enabled by alternate +EX|default, which is already provided by alternate diff --git a/jetty-start/src/test/resources/usecases/files.0.assert.txt b/jetty-start/src/test/resources/usecases/files.0.assert.txt new file mode 100644 index 00000000000..e557ff88854 --- /dev/null +++ b/jetty-start/src/test/resources/usecases/files.0.assert.txt @@ -0,0 +1,2 @@ +DOWNLOAD|basehome:modules/demo/demo-config.xml|etc/demo-config.xml +EXISTS|etc/demo-config.xml diff --git a/jetty-start/src/test/resources/usecases/files.0.prepare.txt b/jetty-start/src/test/resources/usecases/files.0.prepare.txt new file mode 100644 index 00000000000..566c04a7f0c --- /dev/null +++ b/jetty-start/src/test/resources/usecases/files.0.prepare.txt @@ -0,0 +1 @@ +--add-to-startd=demo diff --git a/jetty-start/src/test/resources/usecases/files/modules/demo.mod b/jetty-start/src/test/resources/usecases/files/modules/demo.mod new file mode 100644 index 00000000000..20ad673c9fc --- /dev/null +++ b/jetty-start/src/test/resources/usecases/files/modules/demo.mod @@ -0,0 +1,3 @@ + +[files] +basehome:modules/demo/demo-config.xml|etc/demo-config.xml diff --git a/jetty-start/src/test/resources/usecases/files/modules/demo/demo-config.xml b/jetty-start/src/test/resources/usecases/files/modules/demo/demo-config.xml new file mode 100644 index 00000000000..e69de29bb2d diff --git a/jetty-util/src/main/config/modules/java-util-logging.mod b/jetty-util/src/main/config/modules/java-util-logging.mod new file mode 100644 index 00000000000..80792d70c40 --- /dev/null +++ b/jetty-util/src/main/config/modules/java-util-logging.mod @@ -0,0 +1,8 @@ +[description] +Enables Java util logging + +[provide] +logging + +[exec] +-Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.JavaUtilLog diff --git a/jetty-util/src/main/config/modules/log4j-log4j2.mod b/jetty-util/src/main/config/modules/log4j-log4j2.mod new file mode 100644 index 00000000000..f299f10135d --- /dev/null +++ b/jetty-util/src/main/config/modules/log4j-log4j2.mod @@ -0,0 +1,16 @@ +[description] +Provides Apache Log4j 1.2 bridge to Log4j 2. + +[depends] +log4j2-impl + +[provides] +log4j-api +log4j-impl + +[files] +maven://org.apache.logging.log4j/log4j-1.2-api/2.6.1|lib/log4j/log4j-1.2-api-2.6.1.jar + +[lib] +lib/log4j/log4j-1.2-api-2.6.1.jar + diff --git a/jetty-util/src/main/config/modules/log4j.mod b/jetty-util/src/main/config/modules/log4j.mod new file mode 100644 index 00000000000..3e002bd1f0e --- /dev/null +++ b/jetty-util/src/main/config/modules/log4j.mod @@ -0,0 +1,20 @@ +[description] +Provides Apache Log4j 1.2 + +[depends] +resources + +[provides] +log4j-api +log4j-impl + +[files] +basehome:modules/log4j/log4j.properties|resources/log4j.properties +maven://log4j/log4j/1.2.17|lib/log4j/log4j-1.2.17.jar + +[lib] +lib/log4j/log4j-1.2.17.jar + +[license] +Log4j is released under the Apache 2.0 license. +http://www.apache.org/licenses/LICENSE-2.0.html diff --git a/jetty-home/src/main/resources/resources/log4j.properties b/jetty-util/src/main/config/modules/log4j/log4j.properties similarity index 77% rename from jetty-home/src/main/resources/resources/log4j.properties rename to jetty-util/src/main/config/modules/log4j/log4j.properties index 8899c004be3..4a0a4a35674 100644 --- a/jetty-home/src/main/resources/resources/log4j.properties +++ b/jetty-util/src/main/config/modules/log4j/log4j.properties @@ -1,6 +1,4 @@ -# This is not needed by Jetty - but it helps with many web apps. - log4j.rootLogger=INFO, stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender diff --git a/jetty-util/src/main/config/modules/log4j2-api.mod b/jetty-util/src/main/config/modules/log4j2-api.mod new file mode 100644 index 00000000000..66a6b8c5b5f --- /dev/null +++ b/jetty-util/src/main/config/modules/log4j2-api.mod @@ -0,0 +1,14 @@ +[description] +Provides Apache Log4j 2 API. +Requires a log4j 2 implementation module +Use slf4j-log4j module to link jetty logging + +[files] +maven://org.apache.logging.log4j/log4j-api/2.6.1|lib/log4j/log4j-api-2.6.1.jar + +[lib] +lib/log4j/log4j-api-2.6.1.jar + +[license] +Log4j is released under the Apache 2.0 license. +http://www.apache.org/licenses/LICENSE-2.0.html diff --git a/jetty-util/src/main/config/modules/log4j2-core.mod b/jetty-util/src/main/config/modules/log4j2-core.mod new file mode 100644 index 00000000000..6f94fdb82a2 --- /dev/null +++ b/jetty-util/src/main/config/modules/log4j2-core.mod @@ -0,0 +1,16 @@ +[description] +Provides Apache Log4j 2 Core. + +[depends] +log4j2-api + +[provides] +log4j2-impl + +[files] +basehome:modules/log4j2/log4j2.properties|resources/log4j2.properties +maven://org.apache.logging.log4j/log4j-core/2.6.1|lib/log4j/log4j-core-2.6.1.jar + +[lib] +lib/log4j/log4j-core-2.6.1.jar + diff --git a/jetty-util/src/main/config/modules/log4j2-slf4j.mod b/jetty-util/src/main/config/modules/log4j2-slf4j.mod new file mode 100644 index 00000000000..1c5f55aa8a1 --- /dev/null +++ b/jetty-util/src/main/config/modules/log4j2-slf4j.mod @@ -0,0 +1,17 @@ +[description] +Provides Apache Log4j 2 implementation that routes +logs into slf4j + +[depends] +log4j2-api +slf4j-api + +[provides] +log4j2-impl + +[files] +maven://org.apache.logging.log4j/log4j-to-slf4j/2.6.1|lib/log4j/log4j-to-slf4j-2.6.1.jar + +[lib] +lib/log4j/log4j-slf4j-to-2.6.1.jar + diff --git a/jetty-util/src/main/config/modules/log4j2/log4j2.properties b/jetty-util/src/main/config/modules/log4j2/log4j2.properties new file mode 100644 index 00000000000..ccc1cd19c87 --- /dev/null +++ b/jetty-util/src/main/config/modules/log4j2/log4j2.properties @@ -0,0 +1,11 @@ +status = error +name = PropertiesConfig + +appender.console.type = Console +appender.console.name = STDOUT +appender.console.layout.type = PatternLayout +appender.console.layout.pattern = %m%n + +rootLogger.level = info +rootLogger.appenderRef.stdout.ref = STDOUT + diff --git a/jetty-util/src/main/config/modules/logging.mod b/jetty-util/src/main/config/modules/logging.mod index 8f6f15a5b6a..7cead93c737 100644 --- a/jetty-util/src/main/config/modules/logging.mod +++ b/jetty-util/src/main/config/modules/logging.mod @@ -13,16 +13,6 @@ lib/logging/**.jar resources/ [ini-template] -## Logging Configuration -## Configure jetty logging for default internal behavior STDERR output -# -Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog - -## Configure jetty logging for slf4j -# -Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.Slf4jLog - -## Configure jetty logging for java.util.logging -# -Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.JavaUtilLog - ## Logging directory (relative to $jetty.base) # jetty.logging.dir=logs diff --git a/jetty-util/src/main/config/modules/slf4j-api.mod b/jetty-util/src/main/config/modules/slf4j-api.mod new file mode 100644 index 00000000000..a4b06b7e2ca --- /dev/null +++ b/jetty-util/src/main/config/modules/slf4j-api.mod @@ -0,0 +1,36 @@ +[description] +Provides SLF4J API. Requires a slf4j implementation (eg slf4j-simple) +otherwise a noop implementation is used. + +[provides +logging + +[files] +maven://org.slf4j/slf4j-api/1.7.21|lib/slf4j/slf4j-api-1.7.21.jar + +[lib] +lib/slf4j/slf4j-api-1.7.21.jar + +[license] +SLF4J is distributed under the MIT License. +Copyright (c) 2004-2013 QOS.ch +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/jetty-util/src/main/config/modules/slf4j-log4j12.mod b/jetty-util/src/main/config/modules/slf4j-log4j12.mod new file mode 100644 index 00000000000..b37877789c3 --- /dev/null +++ b/jetty-util/src/main/config/modules/slf4j-log4j12.mod @@ -0,0 +1,16 @@ +[description] +Provides SLF4J Log4j implementation. + +[depend] +slf4j-api +log4j-api + +[provide] +slf4j-impl + +[files] +maven://org.slf4j/slf4j-log4j12/1.7.21|lib/slf4j/slf4j-log4j12-1.7.21.jar + +[lib] +lib/slf4j/slf4j-log4j12-1.7.21.jar + diff --git a/jetty-util/src/main/config/modules/slf4j-simple.mod b/jetty-util/src/main/config/modules/slf4j-simple.mod new file mode 100644 index 00000000000..0cc6a54d601 --- /dev/null +++ b/jetty-util/src/main/config/modules/slf4j-simple.mod @@ -0,0 +1,17 @@ +[description] +Provides SLF4J simple logging + +[depend] +slf4j-api + +[provide] +slf4j-impl + +[files] +maven://org.slf4j/slf4j-simple/1.7.21|lib/slf4j/slf4j-simple-1.7.21.jar + +[lib] +lib/slf4j/slf4j-simple-1.7.21.jar + +[exec] +-Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.Slf4jLog diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/TopologicalSort.java b/jetty-util/src/main/java/org/eclipse/jetty/util/TopologicalSort.java index 077bb7b2010..40dd7266797 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/TopologicalSort.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/TopologicalSort.java @@ -17,8 +17,10 @@ // package org.eclipse.jetty.util; +import java.io.IOException; import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; @@ -28,6 +30,10 @@ import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; +import org.eclipse.jetty.util.component.ContainerLifeCycle; +import org.eclipse.jetty.util.component.Dumpable; +import org.eclipse.jetty.util.component.DumpableCollection; + /** * Topological sort a list or array. @@ -45,7 +51,7 @@ import java.util.TreeSet; * * @param The type to be sorted. It must be able to be added to a {@link HashSet} */ -public class TopologicalSort +public class TopologicalSort implements Dumpable { private final Map> _dependencies = new HashMap<>(); @@ -182,4 +188,17 @@ public class TopologicalSort { return "TopologicalSort "+_dependencies; } + + @Override + public String dump() + { + return ContainerLifeCycle.dump(this); + } + + @Override + public void dump(Appendable out, String indent) throws IOException + { + out.append(String.format("TopologicalSort@%x%n",hashCode())); + ContainerLifeCycle.dump(out, indent,_dependencies.entrySet()); + } } 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 13ddcc58363..b98b77a47d6 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 @@ -183,7 +183,7 @@ public class Log } if (LOG!=null) - LOG.info(String.format("Logging initialized @%dms",Uptime.getUptime())); + LOG.info(String.format("Logging initialized @%dms to %s",Uptime.getUptime(),LOG.getClass().getName())); } }