You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rg...@apache.org on 2021/12/23 16:26:33 UTC

[logging-log4j1] annotated tag v1_2_15_rc5 created (now e7e5d2a)

This is an automated email from the ASF dual-hosted git repository.

rgoers pushed a change to annotated tag v1_2_15_rc5
in repository https://gitbox.apache.org/repos/asf/logging-log4j1.git.


      at e7e5d2a  (tag)
 tagging ac1d06673e8a59eb671f9064d08640b9cd2972d5 (commit)
      by Curtis William Arnold
      on Fri Aug 24 22:50:09 2007 +0000

- Log -----------------------------------------------------------------
v1_2_15_rc5
-----------------------------------------------------------------------

This annotated tag includes the following new commits:

     new ac1d066  [maven-release-plugin]  copy for tag v1_2_15_rc5

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[logging-log4j1] 01/01: [maven-release-plugin] copy for tag v1_2_15_rc5

Posted by rg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rgoers pushed a commit to annotated tag v1_2_15_rc5
in repository https://gitbox.apache.org/repos/asf/logging-log4j1.git

commit ac1d06673e8a59eb671f9064d08640b9cd2972d5
Author: Curtis William Arnold <ca...@apache.org>
AuthorDate: Fri Aug 24 22:50:09 2007 +0000

    [maven-release-plugin]  copy for tag v1_2_15_rc5
    
    git-svn-id: https://svn.apache.org/repos/asf/logging/log4j/tags/v1_2_15_rc5@569553 13f79535-47bb-0310-9956-ffa450edef68
---
 BUILD-INFO.txt                                     |  22 +--
 pom.xml                                            |  20 +-
 src/changes/changes.xml                            |   3 +-
 src/main/java/org/apache/log4j/LogManager.java     |  30 +--
 src/main/java/org/apache/log4j/spi/NOPLogger.java  | 212 +++++++++++++++++++++
 .../org/apache/log4j/spi/NOPLoggerRepository.java  | 131 +++++++++++++
 .../org/apache/log4j/xml/Log4jEntityResolver.java  |   4 +-
 7 files changed, 385 insertions(+), 37 deletions(-)

diff --git a/BUILD-INFO.txt b/BUILD-INFO.txt
index 45a411a..facccd4 100644
--- a/BUILD-INFO.txt
+++ b/BUILD-INFO.txt
@@ -30,9 +30,12 @@ Download Ubuntu-6.06-1 desktop from http://www.vmware.com/vmtn/appliances/direct
 
 Launch Ubuntu 6.06-1 in VMWare Player (user name and password are ubuntu)
 
-Launch Synaptics Package Manager (System > Administration > Synaptic Package Manager), select all available repositories (Settings > Repositories), press Reload button to update list of available packages.  Select the following packages for installation: Subversion, mingw32, sun-java6-jdk.  Press Apply to install.  Exit Synaptics.
+Launch Synaptics Package Manager (System > Administration > Synaptic Package Manager), 
+select all available repositories (Settings > Repositories), press Reload button 
+to update list of available packages.  Select the following packages for installation: 
+Subversion, mingw32, sun-java6-jdk.  Press Apply to install.  Exit Synaptics.
 
-Download Maven-2.0.6 from http://maven.apache.org
+Download Maven-2.0.7 from http://maven.apache.org
 Download JMX 1.2.1 Reference Implementation from 
    http://java.sun.com/products/JavaManagement/download.html
 Download JMS 1.1 from http://java.sun.com/products/jms/docs.html
@@ -43,7 +46,7 @@ Copy include/win32/jni_md.h from a Windows JDK to ~
 From a command prompt:
 
 $ export JAVA_HOME=/usr/lib/jvm/java-6-sun
-$ export PATH=$JAVA_HOME/bin:/home/ubuntu/maven-2.0.6/bin:$PATH
+$ export PATH=$JAVA_HOME/bin:/home/ubuntu/maven-2.0.7/bin:$PATH
 $ export JNI_WIN32_INCLUDE_DIR=/home/ubuntu
 $ svn co https://svn.apache.org/repos/asf/logging/log4j/tags/v1_2_15 log4j
 $ mvn install:install-file -DgroupId=com.sun.jdmk -DartifactId=jmxtools \
@@ -58,7 +61,7 @@ $ mvn site assembly:assembly
 
 If you intended to deploy jars to the repo or update the site,
 you need to copy your private keys for people.apache.org 
-over to ~/.ssh and update ~/maven-2.0.6/conf/settings.xml
+over to ~/.ssh and update ~/maven-2.0.7/conf/settings.xml
 to specify user name and key location.
 
     <server>
@@ -67,14 +70,9 @@ to specify user name and key location.
       <privateKey>/home/ubuntu/.ssh/id_rsa</privateKey>
       <passphrase></passphrase>
     </server>
-    <server>
-      <id>logging.site</id>
-      <username>USERNAME for people.apache.org</username>
-      <privateKey>/home/ubuntu/.ssh/id_rsa</privateKey>
-      <passphrase></passphrase>
-    </server>
 
-You should test your ssh connection to people.apache.org before
-attempting a deployment like:
+You should test your ssh connection to people.apache.org 
+and localhost before attempting a deployment like:
 
 $ ssh -l USERNAME people.apache.org
+$ ssh localhost
diff --git a/pom.xml b/pom.xml
index f3d787a..beb7e27 100644
--- a/pom.xml
+++ b/pom.xml
@@ -21,7 +21,7 @@
   <artifactId>log4j</artifactId>
   <packaging>jar</packaging>
   <name>Apache Log4j</name>
-  <version>1.2.15-SNAPSHOT</version>
+  <version>1.2.15</version>
   <properties>
     <currentVersion>1.2.15</currentVersion>
   </properties>  
@@ -68,9 +68,9 @@
     </license>
   </licenses>
   <scm>
-       <connection>scm:svn:http://svn.apache.org/repos/asf/logging/log4j/trunk</connection>
-       <developerConnection>scm:svn:https://svn.apache.org/repos/asf/logging/log4j/trunk</developerConnection>
-    <url>http://svn.apache.org/viewcvs.cgi/logging/log4j/trunk</url>
+       <connection>scm:svn:http://svn.apache.org/repos/asf/logging/log4j/tags/v1_2_15_rc5</connection>
+       <developerConnection>scm:svn:https://svn.apache.org/repos/asf/logging/log4j/tags/v1_2_15_rc5</developerConnection>
+    <url>http://svn.apache.org/viewcvs.cgi/logging/log4j/tags/v1_2_15_rc5</url>
   </scm>
   <organization>
     <name>Apache Software Foundation</name>
@@ -210,8 +210,8 @@
 			  <ant dir="tests" target="runAll">
 				<property name="junit.jar" location="${user.home}/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar" />
 				<property name="jakarta.oro.jar" location="${user.home}/.m2/repository/oro/oro/2.0.8/oro-2.0.8.jar" />
-                <property name="javamail.jar"  location="${user.home}/.m2/repository/javax/mail/mail/1.4/mail-1.4.jar"/>
-                <property name="activation.jar" location="${user.home}/.m2/repository/javax/activation/activation/1.1/activation-1.1.jar"/>
+                <property name="javamail.jar" location="${user.home}/.m2/repository/javax/mail/mail/1.4/mail-1.4.jar" />
+                <property name="activation.jar" location="${user.home}/.m2/repository/javax/activation/activation/1.1/activation-1.1.jar" />
                 <property name="log4j.jar" location="target/classes" />
 				<property name="project.lib.home" location="target" />
                     </ant> 
@@ -230,7 +230,7 @@
                     <taskdef name="replaceregexp" classname="org.apache.tools.ant.taskdefs.optional.ReplaceRegExp" />                
                    <replaceregexp file="target/site/source-repository.html" match="/tags/[^ ]*" replace="/trunk" flags="g" />
                 <replaceregexp match="-- Generated by (.*) on .*--" replace="-- Generated by \1 --" flags="g">
-					<fileset dir="target/site/apidocs" includes="**/*.html"/>
+					<fileset dir="target/site/apidocs" includes="**/*.html" />
 				</replaceregexp>
                 </tasks>
             </configuration>
@@ -243,7 +243,7 @@
             <id>post-site</id>
             <configuration>
                 <tasks>
-                   <ant target="post-site"/>
+                   <ant target="post-site" />
                 </tasks>
             </configuration>
             <goals>
@@ -255,7 +255,7 @@
             <id>site-deploy</id>
             <configuration>
                 <tasks>
-                   <ant target="site-deploy"/>
+                   <ant target="site-deploy" />
                 </tasks>
             </configuration>
             <goals>
@@ -443,7 +443,7 @@
       <plugin>
           <artifactId>maven-release-plugin</artifactId>
           <configuration>
-              <goals>site-deploy</goals>
+              <goals>deploy site-deploy assembly:attached</goals>
           </configuration>
       </plugin>
       <plugin>
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 0940e61..ccef084 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -22,7 +22,8 @@
   <body>
   
     <release version="1.2.15" date="2007-06-27" description="SyslogAppender enhancements, NTEventLogAppender and Maven build.">
-	   <action action="add" issue="43202">Add 'application' property support to SocketAppender (from 1.3)</action>
+        <action action="add" issue="40212">Switch to NOPLoggerRepository if application reloading nulls repositorySelector.</action>
+	    <action action="add" issue="43202">Add 'application' property support to SocketAppender (from 1.3)</action>
         <action action="fix" issue="43200">Log4JEntityResolver will return null if log4j.dtd can not be found on classpath.</action>
         <action action="fix" issue="37736">HierarchyEventListener.removeAppenderEvent never called.</action>
         <action action="fix" issue="37560">XMLLayout does not escape CDATA sections within NDC or throwables.</action>
diff --git a/src/main/java/org/apache/log4j/LogManager.java b/src/main/java/org/apache/log4j/LogManager.java
index 6c0ebfd..199d15f 100644
--- a/src/main/java/org/apache/log4j/LogManager.java
+++ b/src/main/java/org/apache/log4j/LogManager.java
@@ -22,6 +22,7 @@ import org.apache.log4j.spi.LoggerFactory;
 import org.apache.log4j.spi.RepositorySelector;
 import org.apache.log4j.spi.DefaultRepositorySelector;
 import org.apache.log4j.spi.RootLogger;
+import org.apache.log4j.spi.NOPLoggerRepository;
 import org.apache.log4j.helpers.Loader;
 import org.apache.log4j.helpers.OptionConverter;
 import org.apache.log4j.helpers.LogLog;
@@ -170,6 +171,11 @@ public class LogManager {
   static
   public
   LoggerRepository getLoggerRepository() {
+    if (repositorySelector == null) {
+        repositorySelector = new DefaultRepositorySelector(new NOPLoggerRepository());
+        guard = null;
+        LogLog.error("LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository.");
+    }
     return repositorySelector.getLoggerRepository();
   }
 
@@ -180,7 +186,7 @@ public class LogManager {
   static 
   Logger getRootLogger() {
      // Delegate the actual manufacturing of the logger to the logger repository.
-    return repositorySelector.getLoggerRepository().getRootLogger();
+    return getLoggerRepository().getRootLogger();
   }
 
   /**
@@ -188,9 +194,9 @@ public class LogManager {
   */
   public
   static 
-  Logger getLogger(String name) {
+  Logger getLogger(final String name) {
      // Delegate the actual manufacturing of the logger to the logger repository.
-    return repositorySelector.getLoggerRepository().getLogger(name);
+    return getLoggerRepository().getLogger(name);
   }
 
  /**
@@ -198,9 +204,9 @@ public class LogManager {
   */
   public
   static 
-  Logger getLogger(Class clazz) {
+  Logger getLogger(final Class clazz) {
      // Delegate the actual manufacturing of the logger to the logger repository.
-    return repositorySelector.getLoggerRepository().getLogger(clazz.getName());
+    return getLoggerRepository().getLogger(clazz.getName());
   }
 
 
@@ -209,33 +215,33 @@ public class LogManager {
   */
   public
   static 
-  Logger getLogger(String name, LoggerFactory factory) {
+  Logger getLogger(final String name, final LoggerFactory factory) {
      // Delegate the actual manufacturing of the logger to the logger repository.
-    return repositorySelector.getLoggerRepository().getLogger(name, factory);
+    return getLoggerRepository().getLogger(name, factory);
   }  
 
   public
   static
-  Logger exists(String name) {
-    return repositorySelector.getLoggerRepository().exists(name);
+  Logger exists(final String name) {
+    return getLoggerRepository().exists(name);
   }
 
   public
   static
   Enumeration getCurrentLoggers() {
-    return repositorySelector.getLoggerRepository().getCurrentLoggers();
+    return getLoggerRepository().getCurrentLoggers();
   }
 
   public
   static
   void shutdown() {
-    repositorySelector.getLoggerRepository().shutdown();
+    getLoggerRepository().shutdown();
   }
 
   public
   static
   void resetConfiguration() {
-    repositorySelector.getLoggerRepository().resetConfiguration();
+    getLoggerRepository().resetConfiguration();
   }
 }
 
diff --git a/src/main/java/org/apache/log4j/spi/NOPLogger.java b/src/main/java/org/apache/log4j/spi/NOPLogger.java
new file mode 100644
index 0000000..38b1514
--- /dev/null
+++ b/src/main/java/org/apache/log4j/spi/NOPLogger.java
@@ -0,0 +1,212 @@
+/*
+ * 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.log4j.spi;
+
+import org.apache.log4j.Appender;
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.apache.log4j.Priority;
+
+import java.util.Enumeration;
+import java.util.ResourceBundle;
+import java.util.Vector;
+
+/**
+ * No-operation implementation of Logger used by NOPLoggerRepository.
+ * @since 1.2.15
+ */
+public final class NOPLogger extends Logger {
+    /**
+     * Create instance of Logger.
+     * @param repo repository, may not be null.
+     * @param name name, may not be null, use "root" for root logger.
+     */
+    public NOPLogger(NOPLoggerRepository repo, final String name) {
+        super(name);
+        this.repository = repo;
+        this.level = Level.OFF;
+        this.parent = this;
+    }
+
+    /** {@inheritDoc} */
+    public void addAppender(final Appender newAppender) {
+    }
+
+    /** {@inheritDoc} */
+    public void assertLog(final boolean assertion, final String msg) {
+    }
+
+
+    /** {@inheritDoc} */
+    public void callAppenders(final LoggingEvent event) {
+    }
+
+    /** {@inheritDoc} */
+    void closeNestedAppenders() {
+    }
+
+    /** {@inheritDoc} */
+    public void debug(final Object message) {
+    }
+
+
+    /** {@inheritDoc} */
+    public void debug(final Object message, final Throwable t) {
+    }
+
+    /** {@inheritDoc} */
+    public void error(final Object message) {
+    }
+
+    /** {@inheritDoc} */
+    public void error(final Object message, final Throwable t) {
+    }
+
+
+    /** {@inheritDoc} */
+    public void fatal(final Object message) {
+    }
+
+    /** {@inheritDoc} */
+    public void fatal(final Object message, final Throwable t) {
+    }
+
+
+    /** {@inheritDoc} */
+    public Enumeration getAllAppenders() {
+      return new Vector().elements();
+    }
+
+    /** {@inheritDoc} */
+    public Appender getAppender(final String name) {
+       return null;
+    }
+
+    /** {@inheritDoc} */
+    public Level getEffectiveLevel() {
+      return Level.OFF;
+    }
+
+    /** {@inheritDoc} */
+    public Priority getChainedPriority() {
+      return getEffectiveLevel();
+    }
+
+    /** {@inheritDoc} */
+    public ResourceBundle getResourceBundle() {
+      return null;
+    }
+
+
+    /** {@inheritDoc} */
+    public void info(final Object message) {
+    }
+
+    /** {@inheritDoc} */
+    public void info(final Object message, final Throwable t) {
+    }
+
+    /** {@inheritDoc} */
+    public boolean isAttached(Appender appender) {
+      return false;
+    }
+
+    /** {@inheritDoc} */
+    public boolean isDebugEnabled() {
+      return false;
+    }
+
+    /** {@inheritDoc} */
+    public boolean isEnabledFor(final Priority level) {
+      return false;
+    }
+
+    /** {@inheritDoc} */
+    public boolean isInfoEnabled() {
+      return false;
+    }
+
+
+    /** {@inheritDoc} */
+    public void l7dlog(final Priority priority, final String key, final Throwable t) {
+    }
+
+    /** {@inheritDoc} */
+    public void l7dlog(final Priority priority, final String key,  final Object[] params, final Throwable t) {
+    }
+
+    /** {@inheritDoc} */
+    public void log(final Priority priority, final Object message, final Throwable t) {
+    }
+
+    /** {@inheritDoc} */
+    public void log(final Priority priority, final Object message) {
+    }
+
+    /** {@inheritDoc} */
+    public void log(final String callerFQCN, final Priority level, final Object message, final Throwable t) {
+    }
+
+    /** {@inheritDoc} */
+    public void removeAllAppenders() {
+    }
+
+
+    /** {@inheritDoc} */
+    public void removeAppender(Appender appender) {
+    }
+
+    /** {@inheritDoc} */
+    public void removeAppender(final String name) {
+    }
+
+    /** {@inheritDoc} */
+    public void setLevel(final Level level) {
+    }
+
+
+    /** {@inheritDoc} */
+    public void setPriority(final Priority priority) {
+    }
+
+    /** {@inheritDoc} */
+    public void setResourceBundle(final ResourceBundle bundle) {
+    }
+
+    /** {@inheritDoc} */
+    public void warn(final Object message) {
+    }
+
+    /** {@inheritDoc} */
+    public void warn(final Object message, final Throwable t) {
+    }
+
+    /** {@inheritDoc} */
+    public void trace(Object message) {
+    }
+
+    /** {@inheritDoc} */
+    public void trace(Object message, Throwable t) {
+    }
+
+    /** {@inheritDoc} */
+    public boolean isTraceEnabled() {
+        return false;
+    }
+
+
+}
diff --git a/src/main/java/org/apache/log4j/spi/NOPLoggerRepository.java b/src/main/java/org/apache/log4j/spi/NOPLoggerRepository.java
new file mode 100644
index 0000000..ca92dbe
--- /dev/null
+++ b/src/main/java/org/apache/log4j/spi/NOPLoggerRepository.java
@@ -0,0 +1,131 @@
+/*
+ * 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.log4j.spi;
+
+import org.apache.log4j.Level;
+import org.apache.log4j.Category;
+import org.apache.log4j.Logger;
+import org.apache.log4j.Appender;
+
+import java.util.Enumeration;
+import java.util.Vector;
+
+/**
+ *  No-operation implementation of LoggerRepository which is used when
+ *  LogManager.repositorySelector is erroneously nulled during class reloading.
+ *  @since 1.2.15
+ */
+public final class NOPLoggerRepository implements LoggerRepository {
+    /**
+     * {@inheritDoc}
+    */
+    public void addHierarchyEventListener(final HierarchyEventListener listener) {
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isDisabled(final int level) {
+        return true;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setThreshold(final Level level) {
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setThreshold(final String val) {
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void emitNoAppenderWarning(final Category cat) {
+    }
+
+    /**
+     * @{inheritDoc}
+     */
+    public Level getThreshold() {
+        return Level.OFF;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Logger getLogger(final String name) {
+        return new NOPLogger(this, name);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Logger getLogger(final String name, final LoggerFactory factory) {
+        return new NOPLogger(this, name);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Logger getRootLogger() {
+        return new NOPLogger(this, "root");
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Logger exists(final String name) {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void shutdown() {
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Enumeration getCurrentLoggers() {
+        return new Vector().elements();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Enumeration getCurrentCategories() {
+        return getCurrentLoggers();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public  void fireAddAppenderEvent(Category logger, Appender appender) {
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void resetConfiguration() {
+    }
+}
diff --git a/src/main/java/org/apache/log4j/xml/Log4jEntityResolver.java b/src/main/java/org/apache/log4j/xml/Log4jEntityResolver.java
index 8ff2d61..03a801f 100644
--- a/src/main/java/org/apache/log4j/xml/Log4jEntityResolver.java
+++ b/src/main/java/org/apache/log4j/xml/Log4jEntityResolver.java
@@ -38,8 +38,8 @@ public class Log4jEntityResolver implements EntityResolver {
       Class clazz = getClass();
       InputStream in = clazz.getResourceAsStream("/org/apache/log4j/xml/log4j.dtd");
       if (in == null) {
-	    LogLog.error("Could not find [log4j.dtd]. Used [" + clazz.getClassLoader()
-		     + "] class loader in the search.");
+	    LogLog.warn("Could not find [log4j.dtd] using [" + clazz.getClassLoader()
+		     + "] class loader, parsed without DTD.");
         in = new ByteArrayInputStream(new byte[0]);
       }
 	  return new InputSource(in);