logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sde...@apache.org
Subject svn commit: r568843 - in /logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j: net/MulticastAppender.java net/UDPAppender.java rewrite/PropertyRewritePolicy.java
Date Thu, 23 Aug 2007 06:42:19 GMT
Author: sdeboy
Date: Wed Aug 22 23:42:19 2007
New Revision: 568843

URL: http://svn.apache.org/viewvc?rev=568843&view=rev
Log:
Add javadoc for propertyrewritepolicy describing the name/value pair format
For multicast/udp appenders, always set the hostname as a property

Modified:
    logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/net/MulticastAppender.java
    logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/net/UDPAppender.java
    logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/rewrite/PropertyRewritePolicy.java

Modified: logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/net/MulticastAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/net/MulticastAppender.java?rev=568843&r1=568842&r2=568843&view=diff
==============================================================================
--- logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/net/MulticastAppender.java
(original)
+++ logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/net/MulticastAppender.java
Wed Aug 22 23:42:19 2007
@@ -165,16 +165,11 @@
 	}
 
     if (outSocket != null) {
-      //if the values already exist, don't set (useful when forwarding from a simplesocketserver
-      if (
-        (overrideProperties != null)
-          && overrideProperties.equalsIgnoreCase("true")) {
         event.setProperty(Constants.HOSTNAME_KEY, hostname);
 
         if (application != null) {
           event.setProperty(Constants.APPLICATION_KEY, application);
         }
-      }
       
 		if(locationInfo) {
 		   event.getLocationInformation();

Modified: logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/net/UDPAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/net/UDPAppender.java?rev=568843&r1=568842&r2=568843&view=diff
==============================================================================
--- logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/net/UDPAppender.java
(original)
+++ logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/net/UDPAppender.java
Wed Aug 22 23:42:19 2007
@@ -20,6 +20,7 @@
 import org.apache.log4j.AppenderSkeleton;
 import org.apache.log4j.helpers.Constants;
 import org.apache.log4j.spi.LoggingEvent;
+import org.apache.log4j.xml.XMLLayout;
 import org.apache.log4j.helpers.LogLog;
 
 import java.io.IOException;
@@ -193,15 +194,9 @@
     }
 
     if (outSocket != null) {
-      //if the values already exist, don't set (useful when forwarding from a simplesocketserver
-      if (
-        (overrideProperties != null)
-          && overrideProperties.equalsIgnoreCase("true")) {
-        event.setProperty(Constants.HOSTNAME_KEY, hostname);
-
-        if (application != null) {
-          event.setProperty(Constants.APPLICATION_KEY, application);
-        }
+      event.setProperty(Constants.HOSTNAME_KEY, hostname);
+      if (application != null) {
+        event.setProperty(Constants.APPLICATION_KEY, application);
       }
 
       try {

Modified: logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/rewrite/PropertyRewritePolicy.java
URL: http://svn.apache.org/viewvc/logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/rewrite/PropertyRewritePolicy.java?rev=568843&r1=568842&r2=568843&view=diff
==============================================================================
--- logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/rewrite/PropertyRewritePolicy.java
(original)
+++ logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/rewrite/PropertyRewritePolicy.java
Wed Aug 22 23:42:19 2007
@@ -39,6 +39,13 @@
     public PropertyRewritePolicy() {
     }
 
+    /**
+     * Set a string representing the property name/value pairs.
+     * 
+     * Form: propname1=propvalue1,propname2=propvalue2
+     * 
+     * @param props
+     */
     public void setProperties(String props) {
         Map hashTable = new HashMap();
         StringTokenizer pairs = new StringTokenizer(props, ",");



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message