You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-cvs@jakarta.apache.org by ce...@apache.org on 2001/09/25 00:43:05 UTC
cvs commit: jakarta-log4j/src/java/org/apache/log4j/spi LocationInfo.java LoggerRepository.java
ceki 01/09/24 15:43:05
Modified: build build.xml
docs HISTORY
src/docbook configuration.xml
src/java/org/apache/log4j Hierarchy.java Makefile
src/java/org/apache/log4j/jmx AbstractDynamicMBean.java
AppenderDynamicMBean.java
HierarchyDynamicMBean.java LayoutDynamicMBean.java
src/java/org/apache/log4j/or/jms Makefile
src/java/org/apache/log4j/spi LocationInfo.java
LoggerRepository.java
Log:
Clean build on jmx. Also added copyright notice.
Revision Changes Path
1.48 +17 -1 jakarta-log4j/build/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/jakarta-log4j/build/build.xml,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- build.xml 2001/09/21 09:39:07 1.47
+++ build.xml 2001/09/24 22:43:04 1.48
@@ -88,6 +88,14 @@
</target>
+ <target name="jmxCheck">
+ <available classname="javax.management.MBeanInfo" property="jmx-present"/>
+ </target>
+ <target name="jmx" depends="jmxCheck" if="jmx-present">
+ <echo message="JMX is present."/>
+ </target>
+
+
<target name="jmsCheck">
<available classname="javax.jms.Message" property="jms-present"/>
</target>
@@ -118,7 +126,7 @@
</target>
<target name="build" depends="init, build.core, build.xml, build.unitTests,
- build.javamail, build.jms"/>
+ build.javamail, build.jms, build.jmx"/>
<target name="build.core" depends="init">
<mkdir dir="${javac.dest}" />
@@ -172,6 +180,14 @@
<javac srcdir="${java.source.dir}"
destdir="${javac.dest}"
includes="${stem}/net/JMS*.java"
+ classpath="${classpath}"/>
+ </target>
+
+ <target name="build.jmx" depends="init, jmx, jndi" if="jmx-present">
+ <javac srcdir="${java.source.dir}"
+ destdir="${javac.dest}"
+ includes="${stem}/jmx/*.java"
+ excludes="${stem}/jmx/T.java"
classpath="${classpath}"/>
</target>
1.64 +3 -0 jakarta-log4j/docs/HISTORY
Index: HISTORY
===================================================================
RCS file: /home/cvs/jakarta-log4j/docs/HISTORY,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -r1.63 -r1.64
--- HISTORY 2001/09/05 06:45:28 1.63
+++ HISTORY 2001/09/24 22:43:04 1.64
@@ -9,6 +9,9 @@
- Release of version 1.2alpha_0
+ - Modified SMTPAppender to allow multiple email sessions. Thanks to
+ Jon Skeet for supplying the relevant patch.
+
- The CategoryFactory class has been replaced by the LoggerFactory
class. The makeNewCategoryInstance method has been renamed as
makeNewLoggerInstance. This change requires subclasses of Category
1.6 +8 -0 jakarta-log4j/src/docbook/configuration.xml
Index: configuration.xml
===================================================================
RCS file: /home/cvs/jakarta-log4j/src/docbook/configuration.xml,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- configuration.xml 2001/09/20 22:19:07 1.5
+++ configuration.xml 2001/09/24 22:43:04 1.6
@@ -561,6 +561,14 @@
<title>PropertyConfigurator</title>
<para></para>
</sect1>
+
+ <sect1>
+ <title>SMTPAppender</title>
+ <para>Requires activation.jar, mail.jar. </para>
+ <para>Talk about triggering mechanism</para>
+ <para>Give an example</para>
+ </sect1>
+
<sect1>
<title>DOMConfigurator</title>
1.34 +4 -4 jakarta-log4j/src/java/org/apache/log4j/Hierarchy.java
Index: Hierarchy.java
===================================================================
RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/Hierarchy.java,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- Hierarchy.java 2001/09/08 15:46:14 1.33
+++ Hierarchy.java 2001/09/24 22:43:04 1.34
@@ -270,24 +270,24 @@
}
public
- void fireAddAppenderEvent(Category cat, Appender appender) {
+ void fireAddAppenderEvent(Category logger, Appender appender) {
if(listeners != null) {
int size = listeners.size();
HierarchyEventListener listener;
for(int i = 0; i < size; i++) {
listener = (HierarchyEventListener) listeners.elementAt(i);
- listener.addAppenderEvent(cat, appender);
+ listener.addAppenderEvent(logger, appender);
}
}
}
- void fireRemoveAppenderEvent(Category cat, Appender appender) {
+ void fireRemoveAppenderEvent(Category logger, Appender appender) {
if(listeners != null) {
int size = listeners.size();
HierarchyEventListener listener;
for(int i = 0; i < size; i++) {
listener = (HierarchyEventListener) listeners.elementAt(i);
- listener.removeAppenderEvent(cat, appender);
+ listener.removeAppenderEvent(logger, appender);
}
}
}
1.19 +1 -1 jakarta-log4j/src/java/org/apache/log4j/Makefile
Index: Makefile
===================================================================
RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/Makefile,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- Makefile 2001/09/05 06:45:28 1.18
+++ Makefile 2001/09/24 22:43:04 1.19
@@ -36,7 +36,7 @@
endif
-SUBDIRS :=helpers spi config or xml net nt varia test performance examples
+SUBDIRS :=helpers spi config or xml net nt varia jmx test performance examples
# include master-rule file
include $(DEPTH)/make/make.inc
1.2 +7 -0 jakarta-log4j/src/java/org/apache/log4j/jmx/AbstractDynamicMBean.java
Index: AbstractDynamicMBean.java
===================================================================
RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/jmx/AbstractDynamicMBean.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AbstractDynamicMBean.java 2001/09/24 22:16:27 1.1
+++ AbstractDynamicMBean.java 2001/09/24 22:43:04 1.2
@@ -1,3 +1,10 @@
+/*
+ * Copyright (C) The Apache Software Foundation. All rights reserved.
+ *
+ * This software is published under the terms of the Apache Software
+ * License version 1.1, a copy of which has been included with this
+ * distribution in the LICENSE.txt file. */
+
package org.apache.log4j.jmx;
//import java.lang.reflect.Constructor;
1.2 +14 -19 jakarta-log4j/src/java/org/apache/log4j/jmx/AppenderDynamicMBean.java
Index: AppenderDynamicMBean.java
===================================================================
RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/jmx/AppenderDynamicMBean.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AppenderDynamicMBean.java 2001/09/24 22:16:27 1.1
+++ AppenderDynamicMBean.java 2001/09/24 22:43:04 1.2
@@ -1,3 +1,9 @@
+/*
+ * Copyright (C) The Apache Software Foundation. All rights reserved.
+ *
+ * This software is published under the terms of the Apache Software
+ * License version 1.1, a copy of which has been included with this
+ * distribution in the LICENSE.txt file. */
package org.apache.log4j.jmx;
@@ -86,7 +92,7 @@
true,
writeMethod != null,
false));
- dynamicProps.put(name, new B(readMethod, writeMethod));
+ dynamicProps.put(name, new MethodUnion(readMethod, writeMethod));
}
}
}
@@ -219,13 +225,13 @@
}
}
- B b = (B) dynamicProps.get(attributeName);
+ MethodUnion mu = (MethodUnion) dynamicProps.get(attributeName);
//cat.debug("----name="+attributeName+", b="+b);
- if(b != null && b.readMethod != null) {
+ if(mu != null && mu.readMethod != null) {
try {
- return b.readMethod.invoke(appender, null);
+ return mu.readMethod.invoke(appender, null);
} catch(Exception e) {
return null;
}
@@ -265,12 +271,12 @@
- B b = (B) dynamicProps.get(name);
+ MethodUnion mu = (MethodUnion) dynamicProps.get(name);
- if(b != null && b.writeMethod != null) {
+ if(mu != null && mu.writeMethod != null) {
Object[] o = new Object[1];
- Class[] params = b.writeMethod.getParameterTypes();
+ Class[] params = mu.writeMethod.getParameterTypes();
if(params[0] == org.apache.log4j.Priority.class) {
value = OptionConverter.toLevel((String) value,
(Level) getAttribute(name));
@@ -278,7 +284,7 @@
o[0] = value;
try {
- b.writeMethod.invoke(appender, o);
+ mu.writeMethod.invoke(appender, o);
} catch(Exception e) {
cat.error("FIXME", e);
@@ -304,14 +310,3 @@
}
-
- class B {
- Method readMethod;
- Method writeMethod;
-
- B(Method readMethod, Method writeMethod) {
- this.readMethod = readMethod;
- this.writeMethod = writeMethod;
- }
-
- }
1.2 +10 -7 jakarta-log4j/src/java/org/apache/log4j/jmx/HierarchyDynamicMBean.java
Index: HierarchyDynamicMBean.java
===================================================================
RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/jmx/HierarchyDynamicMBean.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- HierarchyDynamicMBean.java 2001/09/24 22:16:27 1.1
+++ HierarchyDynamicMBean.java 2001/09/24 22:43:04 1.2
@@ -1,13 +1,16 @@
+/*
+ * Copyright (C) The Apache Software Foundation. All rights reserved.
+ *
+ * This software is published under the terms of the Apache Software
+ * License version 1.1, a copy of which has been included with this
+ * distribution in the LICENSE.txt file. */
package org.apache.log4j.jmx;
import java.lang.reflect.Constructor;
-import org.apache.log4j.Hierarchy;
-import org.apache.log4j.Appender;
-import org.apache.log4j.LogManager;
-import org.apache.log4j.Logger;
-import org.apache.log4j.Level;
+import org.apache.log4j.*;
+
import org.apache.log4j.spi.HierarchyEventListener;
import org.apache.log4j.spi.LoggerRepository;
import org.apache.log4j.helpers.OptionConverter;
@@ -226,7 +229,7 @@
public
- void addAppenderEvent(Logger logger, Appender appender) {
+ void addAppenderEvent(Category logger, Appender appender) {
log.debug("addAppenderEvent called: logger="+logger.getName()+
", appender="+appender.getName());
Notification n = new Notification(ADD_APPENDER+logger.getName(), this, 0);
@@ -236,7 +239,7 @@
}
public
- void removeAppenderEvent(Logger cat, Appender appender) {
+ void removeAppenderEvent(Category cat, Appender appender) {
log.debug("removeAppenderCalled: logger="+cat.getName()+
", appender="+appender.getName());
}
1.2 +15 -19 jakarta-log4j/src/java/org/apache/log4j/jmx/LayoutDynamicMBean.java
Index: LayoutDynamicMBean.java
===================================================================
RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/jmx/LayoutDynamicMBean.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- LayoutDynamicMBean.java 2001/09/24 22:16:27 1.1
+++ LayoutDynamicMBean.java 2001/09/24 22:43:04 1.2
@@ -1,3 +1,9 @@
+/*
+ * Copyright (C) The Apache Software Foundation. All rights reserved.
+ *
+ * This software is published under the terms of the Apache Software
+ * License version 1.1, a copy of which has been included with this
+ * distribution in the LICENSE.txt file. */
package org.apache.log4j.jmx;
@@ -89,7 +95,7 @@
true,
writeMethod != null,
false));
- dynamicProps.put(name, new B(readMethod, writeMethod));
+ dynamicProps.put(name, new MethodUnion(readMethod, writeMethod));
}
}
}
@@ -169,13 +175,13 @@
}
- B b = (B) dynamicProps.get(attributeName);
+ MethodUnion mu = (MethodUnion) dynamicProps.get(attributeName);
- cat.debug("----name="+attributeName+", b="+b);
+ cat.debug("----name="+attributeName+", mu="+mu);
- if(b != null && b.readMethod != null) {
+ if(mu != null && mu.readMethod != null) {
try {
- return b.readMethod.invoke(layout, null);
+ return mu.readMethod.invoke(layout, null);
} catch(Exception e) {
return null;
}
@@ -215,12 +221,12 @@
- B b = (B) dynamicProps.get(name);
+ MethodUnion mu = (MethodUnion) dynamicProps.get(name);
- if(b != null && b.writeMethod != null) {
+ if(mu != null && mu.writeMethod != null) {
Object[] o = new Object[1];
- Class[] params = b.writeMethod.getParameterTypes();
+ Class[] params = mu.writeMethod.getParameterTypes();
if(params[0] == org.apache.log4j.Priority.class) {
value = OptionConverter.toLevel((String) value,
(Level) getAttribute(name));
@@ -228,7 +234,7 @@
o[0] = value;
try {
- b.writeMethod.invoke(layout, o);
+ mu.writeMethod.invoke(layout, o);
} catch(Exception e) {
cat.error("FIXME", e);
@@ -242,13 +248,3 @@
}
- class B {
- Method readMethod;
- Method writeMethod;
-
- B(Method readMethod, Method writeMethod) {
- this.readMethod = readMethod;
- this.writeMethod = writeMethod;
- }
-
- }
1.2 +1 -1 jakarta-log4j/src/java/org/apache/log4j/or/jms/Makefile
Index: Makefile
===================================================================
RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/or/jms/Makefile,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Makefile 2001/09/10 09:31:01 1.1
+++ Makefile 2001/09/24 22:43:05 1.2
@@ -1,5 +1,5 @@
-PKG_DIR :=org/apache/log4j/or/sax
+PKG_DIR :=org/apache/log4j/or/jms
DEPTH :=../../../../../../..
JSOURCES:= MessageRenderer.java
1.10 +1 -1 jakarta-log4j/src/java/org/apache/log4j/spi/LocationInfo.java
Index: LocationInfo.java
===================================================================
RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/spi/LocationInfo.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- LocationInfo.java 2001/08/06 20:21:01 1.9
+++ LocationInfo.java 2001/09/24 22:43:05 1.10
@@ -151,7 +151,7 @@
if(iend == -1)
className = NA;
else {
- iend = fullInfo.lastIndexOf('.', iend);
+ iend =fullInfo.lastIndexOf('.', iend);
// This is because a stack trace in VisualAge looks like:
1.4 +7 -1 jakarta-log4j/src/java/org/apache/log4j/spi/LoggerRepository.java
Index: LoggerRepository.java
===================================================================
RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/spi/LoggerRepository.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- LoggerRepository.java 2001/09/05 06:45:29 1.3
+++ LoggerRepository.java 2001/09/24 22:43:05 1.4
@@ -7,6 +7,9 @@
public interface LoggerRepository {
+ public
+ void addHierarchyEventListener(HierarchyEventListener listener);
+
boolean isDisabled(int level);
public
@@ -19,6 +22,9 @@
void emitNoAppenderWarning(Category cat);
public
+ Level getEnable();
+
+ public
Logger getLogger(String name);
public
@@ -47,7 +53,7 @@
public
abstract
- void fireAddAppenderEvent(Category cat, Appender appender);
+ void fireAddAppenderEvent(Category logger, Appender appender);
public
abstract
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-cvs-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-cvs-help@jakarta.apache.org