You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by gg...@apache.org on 2018/04/02 18:51:49 UTC
logging-log4j2 git commit: [LOG4J2-2302]Status logger should show the
Log4j name and version when initializing itself.
Repository: logging-log4j2
Updated Branches:
refs/heads/master 22feccdec -> 3930ee833
[LOG4J2-2302]Status logger should show the Log4j name and version when
initializing itself.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/3930ee83
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/3930ee83
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/3930ee83
Branch: refs/heads/master
Commit: 3930ee8337bac09cab3b6613c9cb94514ed21f87
Parents: 22feccd
Author: Gary Gregory <ga...@gmail.com>
Authored: Mon Apr 2 12:51:41 2018 -0600
Committer: Gary Gregory <ga...@gmail.com>
Committed: Mon Apr 2 12:51:41 2018 -0600
----------------------------------------------------------------------
.../org/apache/logging/log4j/core/Version.java | 34 ++++++++++++++++++++
.../core/config/AbstractConfiguration.java | 5 +--
src/changes/changes.xml | 6 ++++
3 files changed, 43 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3930ee83/log4j-core/src/main/java/org/apache/logging/log4j/core/Version.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/Version.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/Version.java
new file mode 100644
index 0000000..afab5c9
--- /dev/null
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/Version.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+
+package org.apache.logging.log4j.core;
+
+public class Version {
+
+ public static void main(final String[] args) {
+ System.out.println(getProductString());
+ }
+
+ public static String getProductString() {
+ final Package pkg = Version.class.getPackage();
+ if (pkg == null) {
+ return "Apache Log4j";
+ }
+ return String.format("%s %s", pkg.getSpecificationTitle(), pkg.getSpecificationVersion());
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3930ee83/log4j-core/src/main/java/org/apache/logging/log4j/core/config/AbstractConfiguration.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/AbstractConfiguration.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/AbstractConfiguration.java
index a22468d..34fe325 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/AbstractConfiguration.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/AbstractConfiguration.java
@@ -43,6 +43,7 @@ import org.apache.logging.log4j.core.Layout;
import org.apache.logging.log4j.core.LifeCycle2;
import org.apache.logging.log4j.core.LogEvent;
import org.apache.logging.log4j.core.LoggerContext;
+import org.apache.logging.log4j.core.Version;
import org.apache.logging.log4j.core.appender.AsyncAppender;
import org.apache.logging.log4j.core.appender.ConsoleAppender;
import org.apache.logging.log4j.core.async.AsyncLoggerConfig;
@@ -209,7 +210,7 @@ public abstract class AbstractConfiguration extends AbstractFilterable implement
*/
@Override
public void initialize() {
- LOGGER.debug("Initializing configuration {}", this);
+ LOGGER.debug(Version.getProductString() + " initializing configuration {}", this);
subst.setConfiguration(this);
try {
scriptManager = new ScriptManager(this, watchManager);
@@ -239,7 +240,7 @@ public abstract class AbstractConfiguration extends AbstractFilterable implement
LOGGER.debug("Configuration {} initialized", this);
}
- /**
+ /**
* Start the configuration.
*/
@Override
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3930ee83/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index c3ec3c5..53469c8 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -109,6 +109,9 @@
<action issue="LOG4J2-2300" dev="ggregory" type="fix">
PoolingDriverConnectionSource does not take into account properties, user name, and password.
</action>
+ <action issue="LOG4J2-2302" dev="ggregory" type="update">
+ Status logger should show the Log4j name and version when initializing itself.
+ </action>
</release>
<release version="2.11.1" date="2018-MM-DD" description="GA Release 2.11.1">
<action issue="LOG4J2-2268" dev="rgoers" type="fix" due-to="Tilman Hausherr">
@@ -120,6 +123,9 @@
<action issue="LOG4J2-2300" dev="ggregory" type="fix">
PoolingDriverConnectionSource does not take into account properties, user name, and password.
</action>
+ <action issue="LOG4J2-2302" dev="ggregory" type="update">
+ Status logger should show the Log4j name and version when initializing itself.
+ </action>
</release>
<release version="2.11.0" date="2018-xx-xx" description="GA Release 2.11.0">
<action issue="LOG4J2-2104" dev="rgoers" type="fix">