2009-11-11 45 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