logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ceki Gülcü <c...@qos.ch>
Subject Re: Log4j.DTD update
Date Tue, 18 Feb 2003 21:45:37 GMT

If you like, you can update the DTD yourself and submit a patch...

At 12:22 18.02.2003 -0800, you wrote:
>Thanks for the fix, Ceki.
>
>How do I request the DTD be updated to reflect the missing capabilities
>in LoggingEvent?  I need support in the .dtd for the new properties and
>the MDC.  Would this require a new version of 1.3 as well?
>
>Thanks,
>Scott
>
>-----Original Message-----
>From: ceki@apache.org [mailto:ceki@apache.org]
>Sent: Tuesday, February 18, 2003 11:58 AM
>To: jakarta-log4j-cvs@apache.org
>Subject: cvs commit: jakarta-log4j/src/java/org/apache/log4j/spi
>LoggingEvent.java
>
>
>ceki        2003/02/18 11:58:10
>
>   Modified:    src/java/org/apache/log4j/spi LoggingEvent.java
>   Log:
>   Added a property map, similar to the one found in javax.jms.Message.
>
>   The intention is to let appenders set properties and have layouts
>access them.
>
>   Revision  Changes    Path
>   1.35      +27 -0
>jakarta-log4j/src/java/org/apache/log4j/spi/LoggingEvent.java
>
>   Index: LoggingEvent.java
>   ===================================================================
>   RCS file:
>/home/cvs/jakarta-log4j/src/java/org/apache/log4j/spi/LoggingEvent.java,
>v
>   retrieving revision 1.34
>   retrieving revision 1.35
>   diff -u -r1.34 -r1.35
>   --- LoggingEvent.java 21 Oct 2002 23:20:34 -0000      1.34
>   +++ LoggingEvent.java 18 Feb 2003 19:58:09 -0000      1.35
>   @@ -81,6 +81,11 @@
>      /** The mapped diagnostic context (MDC) of logging event. */
>      private Hashtable mdcCopy;
>
>   +  /** A map of String keys and String values.
>   +      @since 1.3
>   +   */
>   +  private Hashtable properties;
>   +
>      /** Have we tried to do an NDC lookup? If we did, there is no need
>       *  to do it again.  Note that its value is always false when
>       *  serialized. Thus, a receiving SocketNode will never use it's
>own
>   @@ -274,6 +279,17 @@
>          }
>        }
>      }
>   +
>   +  /**
>   +   * Return a previously set property. The return value can be null.
>   +   * @since 1.3
>   +   * */
>   +  public String getProperty(String key) {
>   +    if(properties == null)
>   +      return null;
>   +    else
>   +      return (String) properties.get(key);
>   +  }
>
>      public String getRenderedMessage() {
>        if (renderedMessage == null && message != null) {
>   @@ -367,6 +383,17 @@
>        // Make sure that no location info is available to Layouts
>        if (locationInfo == null)
>          locationInfo = new LocationInfo(null, null);
>   +  }
>   +
>   +  /**
>   +   * Set a string property using a key and a string value.
>   +   * since 1.3
>   +   */
>   +  public void setProperty(String key, String value) {
>   +    if(properties == null) {
>   +      properties = new Hashtable(5); // create a small hashtable
>   +    }
>   +    properties.put(key, value);
>      }
>
>      private void writeObject(ObjectOutputStream oos) throws
>java.io.IOException {
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: log4j-dev-help@jakarta.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: log4j-dev-help@jakarta.apache.org

--
Ceki 


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


Mime
View raw message