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 ce...@apache.org on 2004/05/10 11:12:25 UTC
cvs commit: logging-log4j/src/java/org/apache/log4j/spi LoggingEvent.java
ceki 2004/05/10 02:12:25
Modified: src/java/org/apache/log4j/spi LoggingEvent.java
Log:
Added method for setting the NDC string.
Revision Changes Path
1.54 +12 -0 logging-log4j/src/java/org/apache/log4j/spi/LoggingEvent.java
Index: LoggingEvent.java
===================================================================
RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/spi/LoggingEvent.java,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- LoggingEvent.java 9 May 2004 19:15:03 -0000 1.53
+++ LoggingEvent.java 10 May 2004 09:12:25 -0000 1.54
@@ -479,6 +479,18 @@
return ndc;
}
+ /**
+ * This method sets the NDC string for this event.
+ * @throws IllegalStateException if ndc had been already set.
+ * @since 1.3
+ */
+ public void setNDC(String ndcString) {
+ if (this.ndc != null) {
+ throw new IllegalStateException("The ndc has been already set.");
+ }
+ ndcLookupRequired = false;
+ ndc = ndcString;
+ }
/**
* Returns the the context corresponding to the <code>key</code> parameter.
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org