Is it possible to log the session ID in the access log 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());
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With