WebLogic 8.1.6のアクセスログにセッションIDを記録することはできますか?
4744 次
1 に答える
8
はい、これは拡張ログ形式とカスタムフィールド識別子を使用して可能です。以下のセッションIDを出力するカスタムフィールドのJava実装を提供しています。2番目のリンクの手順に従って、ソリューション全体をセットアップします。好みに応じて、完全修飾名を変更します。
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());
}
}
于 2009-11-11T19:02:23.270 に答える