You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by ho...@apache.org on 2004/11/29 02:57:15 UTC
cvs commit: logging-log4j/src/java/org/apache/log4j LogManager.java
hoju 2004/11/28 17:57:15
Modified: src/java/org/apache/log4j LogManager.java
Log:
Set the guard in the case that the JVM was started with -Dlog4j.repositorySelectorClass=[JNDI | <fully qualified class name>] since this is an explicit action to set the repository selector and entirely equivalent to calling LogManger.setRepositorySelector().
Jake
Revision Changes Path
1.24 +6 -1 logging-log4j/src/java/org/apache/log4j/LogManager.java
Index: LogManager.java
===================================================================
RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/LogManager.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- LogManager.java 6 Sep 2004 15:32:49 -0000 1.23
+++ LogManager.java 29 Nov 2004 01:57:14 -0000 1.24
@@ -60,6 +60,7 @@
} else if (repositorySelectorStr.equalsIgnoreCase("JNDI")) {
System.out.println("*** Will use ContextJNDISelector **");
repositorySelector = new ContextJNDISelector();
+ guard = new Object();
} else {
Object r =
OptionConverter.instantiateByClassName(
@@ -70,6 +71,7 @@
"*** Using [" + repositorySelectorStr
+ "] instance as repository selector.");
repositorySelector = (RepositorySelector) r;
+ guard = new Object();
} else {
System.out.println(
"*** Could not insantiate [" + repositorySelectorStr
@@ -115,7 +117,10 @@
Sets <code>RepositorySelector</code> but only if the correct
<em>guard</em> is passed as parameter.
- <p>Initally the guard is null. If the guard is
+ <p>Initally the guard is null, unless the JVM is started with the
+ log4j.repositorySelectorClass system property
+ (-Dlog4j.repositorySelectorClass=[JNDI | <fully qualified class name>]).
+ If the guard is
<code>null</code>, then invoking this method sets the logger
repository and the guard. Following invocations will throw a {@link
IllegalArgumentException}, unless the previously set
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org