Index: src/java/org/apache/log/LogEvent.java
===================================================================
RCS file: /home/cvspublic/jakarta-avalon-logkit/src/java/org/apache/log/LogEvent.java,v
retrieving revision 1.2
diff -u -r1.2 LogEvent.java
--- src/java/org/apache/log/LogEvent.java	2001/05/12 05:38:56	1.2
+++ src/java/org/apache/log/LogEvent.java	2001/07/24 14:34:40
@@ -7,6 +7,9 @@
  */
 package org.apache.log;
 
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
 /**
  * This class encapsulates each individual log event.
  * LogEvents usually originate at a Logger and are routed
@@ -37,6 +40,7 @@
     ///The context stack associated with LogEvent.
     private ContextStack             m_contextStack;
 
+
     /**
      * Get Priority for LogEvent.
      *
@@ -168,4 +172,49 @@
     {
         m_time = time;
     }
+    
+    /**
+     * Get the method path name for the method from which the LogEvent was
+     * created, this includes the path name and the source filename and line
+     * number if the source was compiled with debugging on.
+     *
+     * @returns The method path name in the form "the.package.path.Method"
+     * @author Stuart Roebuck <a href="mailto:stuart.roebuck@adolos.com">&lt;stuart.roebuck@adolos.com&gt;</a>
+     */
+    public final String getMethod() {
+    	StringWriter stringWriter = new StringWriter();
+    	PrintWriter printWriter = new PrintWriter(stringWriter);
+    	StringBuffer currentLine = new StringBuffer();
+        new Throwable().printStackTrace(printWriter);
+        StringBuffer buffer = stringWriter.getBuffer();
+        int length = buffer.length();
+        int state = 0;
+        char c;
+        for (int i = 0; i < length; i++) {
+            c = buffer.charAt(i);
+            switch (state) {
+                case 0:
+                    if (c == '\n') state = 1;
+                    break;
+                case 1:
+                    if (c == 't') state = 2;
+                    break;
+                case 2:
+                    currentLine.setLength(0);
+                    state = 3;
+                    break;
+                case 3:
+                    if (c != '\n') currentLine.append(c);
+                    else {
+                        String method = currentLine.toString();
+                        if (!method.startsWith("org.apache.log")) {
+                            return method;
+                        }
+                        state = 1;
+                    }
+            }
+        }
+        return "";
+    }
+    
 }
Index: src/java/org/apache/log/format/PatternFormatter.java
===================================================================
RCS file: /home/cvspublic/jakarta-avalon-logkit/src/java/org/apache/log/format/PatternFormatter.java,v
retrieving revision 1.8
diff -u -r1.8 PatternFormatter.java
--- src/java/org/apache/log/format/PatternFormatter.java	2001/07/24 11:35:30	1.8
+++ src/java/org/apache/log/format/PatternFormatter.java	2001/07/24 14:34:45
@@ -36,6 +36,7 @@
     protected final static int         TYPE_RELATIVE_TIME   = 6;
     protected final static int         TYPE_THROWABLE       = 7;
     protected final static int         TYPE_PRIORITY        = 8;
+    protected final static int	       TYPE_METHOD	    = 9;
 
     protected final static String      TYPE_CATEGORY_STR      = "category";
     protected final static String      TYPE_CONTEXT_STR       = "context";
@@ -44,6 +45,7 @@
     protected final static String      TYPE_RELATIVE_TIME_STR = "rtime";
     protected final static String      TYPE_THROWABLE_STR     = "throwable";
     protected final static String      TYPE_PRIORITY_STR      = "priority";
+    protected final static String      TYPE_METHOD_STR	      = "method";
 
     protected final static String      SPACE_16               = "                ";
     protected final static String      SPACE_8                = "        ";
@@ -346,6 +348,10 @@
                 str = getPriority( event.getPriority(), run.m_format );
                 break;
 
+            case TYPE_METHOD:
+                str = getMethod( event.getMethod(), run.m_format );
+                break;
+
             default:
                 //TODO: Convert next line to use error handler
                 Hierarchy.getDefaultHierarchy().log( "Unknown Pattern specification." + run.m_type );
@@ -480,15 +486,25 @@
         else if( type.equalsIgnoreCase( TYPE_PRIORITY_STR ) ) return TYPE_PRIORITY;
         else if( type.equalsIgnoreCase( TYPE_TIME_STR ) ) return TYPE_TIME;
         else if( type.equalsIgnoreCase( TYPE_RELATIVE_TIME_STR ) ) return TYPE_RELATIVE_TIME;
-        else if( type.equalsIgnoreCase( TYPE_THROWABLE_STR ) )
-        {
-            return TYPE_THROWABLE;
-        }
+        else if( type.equalsIgnoreCase( TYPE_THROWABLE_STR ) ) return TYPE_THROWABLE;
+        else if( type.equalsIgnoreCase( TYPE_METHOD_STR ) ) return TYPE_METHOD;
         else
         {
             throw new IllegalArgumentException( "Unknown Type in pattern - " +
                                                 type );
         }
+    }
+    
+    /**
+     * Utility method to format method.
+     *
+     * @param method the method path name of the logging method.
+     * @param format ancilliary format parameter - allowed to be null
+     * @return the formatted string
+     */
+    protected String getMethod( final String method, final String format )
+    {
+        return method;
     }
 
     /**
Index: src/xdocs/whitepaper.xml
===================================================================
RCS file: /home/cvspublic/jakarta-avalon-logkit/src/xdocs/whitepaper.xml,v
retrieving revision 1.2
diff -u -r1.2 whitepaper.xml
--- src/xdocs/whitepaper.xml	2001/06/21 14:16:57	1.2
+++ src/xdocs/whitepaper.xml	2001/07/24 14:34:46
@@ -264,7 +264,7 @@
         should be left or right justified (defaults to left justified if unspecified).
         The #.# indicates the minimum and maximum size of output, if unspecified the
         output is neither padded nor truncated. 'field' indicates the field to be 
-        written and must be one of "category", "context", "message", "time", 
+        written and must be one of "category", "context", "method", "message", "time", 
         "throwable" or "priority". This parameter must be supplied and correlates to
         fields of LogEvent. 'subformat' is currently unused. 
       </p>
