WebLogic HTTP Header to log OPRID for PeopleSoft pages to the access log (from @ripleymj).
import weblogic.servlet.logging.CustomELFLogger; | |
import weblogic.servlet.logging.FormatStringBuffer; | |
import weblogic.servlet.logging.HttpAccountingInfo; | |
import java.lang.reflect.Method; | |
public class OPRIDLogField implements CustomELFLogger | |
{ | |
public void logField(HttpAccountingInfo metrics, FormatStringBuffer buff) | |
{ | |
Object psperfenv = metrics.getAttribute("psperfenv"); | |
if(psperfenv != null) | |
{ | |
try | |
{ | |
Method getOperID = psperfenv.getClass().getMethod("getOPERID"); | |
buff.appendValueOrDash(getOperID.invoke(psperfenv).toString()); | |
} | |
catch(Exception e) | |
{ | |
buff.appendValueOrDash("exception"); | |
} | |
} | |
} | |
} |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@ripleymj - fixed the attribution in the description :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
The log field is named
x-OPRIDLogField
.To compile:
javac -cp weblogic.jar OPRIDLogField.java && jar cf olf.jar OPRIDLogField.class
Copy the
OPRIDLogField.jar
to a folder on the web server and add the path theCLASSPATH
option insetEnv
.