我正在尝试在访问日志中记录Authenticated用户名。我能知道它是如何形成的。
我为此编写了自定义类。并将其添加到weblogic启动类路径中。我在启动weblogic时遇到错误。 这是错误
<Error> <HTTP> <BEA-101231> <HTTP log file does not use version 1.0 of the Extended Log File format.>
<Jan 7, 2011 1:07:22 PM GMT+05:30> <Error> <HTTP> <BEA-101234> <Attempting to initialize ExtendedLogFormat application specific header: x-MyCustomField. However, failed due to exception.>
有谁知道这个问题。请帮忙
这是我的课程
` import weblogic.servlet.logging.CustomELFLogger; import weblogic.servlet.logging.FormatStringBuffer; import weblogic.servlet.logging.HttpAccountingInfo;
/* This example outputs the User-Agent field into a
custom field called MyCustomField
*/
public class MyCustomField implements CustomELFLogger{
public void logField(HttpAccountingInfo metrics,
FormatStringBuffer buff) {
buff.appendQuotedValueOrDash(metrics.getRemoteUser());
}
}
`
答案 0 :(得分:0)
我得到了解决方案。需要使用用户定义的类生成jar文件,然后需要在weblogic启动类中加载这些类。所以没问题。
但仍然无法在http标头中找到用户名和密码。
答案 1 :(得分:-1)
大写使用'x'('X-MyCustomField'而不是'x-MyCustomField')