开发者

How to log session ID in weblogic's access log

开发者 https://www.devze.com 2022-12-11 17:00 出处:网络
Is it possible to log the session ID in the access l开发者_JAVA百科og of WebLogic 8.1.6?Yes, this is possible using Extended Log Format and Custom Field Identifiers. I\'m providing a Java implementati

Is it possible to log the session ID in the access l开发者_JAVA百科og of WebLogic 8.1.6?


Yes, this is possible using Extended Log Format and Custom Field Identifiers. I'm providing a Java implementation of a custom field printing the session ID below. Follow the steps of the 2nd link to setup the whole solution. Adapt the fully-qualified name as per your preferences.

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

精彩评论

暂无评论...
验证码 换一张
取 消