5
是否可以在WebLogic 8.1.6的访问日志中记录会话ID?如何在weblogic的访问日志中记录会话ID
是否可以在WebLogic 8.1.6的访问日志中记录会话ID?如何在weblogic的访问日志中记录会话ID
是的,这可以使用Extended Log Format和Custom 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());
}
}
只需更新较新的文档信息:http://download.oracle.com/docs/cd/E14571_01/web.1111/e13701/web_server.htm#i1066198 – 2011-08-23 13:15:08