How to register a session ID in a weblog access log

Is it possible to register the session identifier in the WebLogic 8.1.6 access log?

+5
source share
1 answer

Yes, it is possible using Extended Log Format and Custom Field IDs . I provide a Java implementation for a custom field by printing out the session ID below. Follow the steps of the 2nd link to configure the entire solution. Adapt the full name to your preference.

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());
    }
}
+7
source

All Articles