WebLogic HTTP Header to log OPRID for PeopleSoft pages to the access log (from @ripleymj).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@ripleymj - fixed the attribution in the description :)