2009-11-11 38 views

回答

7

是的,這可以使用Extended Log FormatCustom Field Identifiers。我在下面提供了一個打印會話ID的自定義字段的Java實現。按照第二個鏈接的步驟設置整個解決方案。根據您的偏好調整完全限定的名稱。

import weblogic.servlet.logging.CustomELFLogger; 
import weblogic.servlet.logging.FormatStringBuffer; 
import weblogic.servlet.logging.HttpAccountingInfo; 

/** 
* Outputs the session ID specified by the client into a custom field called MyCustomField 
*/ 
public class MyCustomField implements CustomELFLogger { 

    public void logField(HttpAccountingInfo metrics, FormatStringBuffer buff) { 
     buff.appendValueOrDash(metrics.getRequestedSessionId()); 
    } 
} 
+0

只需更新較新的文檔信息:http://download.oracle.com/docs/cd/E14571_01/web.1111/e13701/web_server.htm#i1066198 – 2011-08-23 13:15:08