weblogic 9.1 访问日志中的 http 扩展日志记录格式
我正在尝试在访问日志中记录经过身份验证的用户名。我可以知道如何记录它吗?
我已经为此编写了自定义类。并将其添加到 weblogic 启动类路径中。我在启动 weblogic 时收到错误。 这是错误
有人知道这个问题吗?请帮助
这是我的课程
` 导入 weblogic.servlet.logging.CustomELFLogger; 导入 weblogic.servlet.logging.FormatStringBuffer; 导入 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());
}
}
`
I am trying to log the Authenticated user name in access logs. can i know how tolog it.
I have written my custom class for that.And added it to weblogic startup classpath. I am getting the error while starting the weblogic.
here is the error
<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.>
does anyone know the issue. pls help
here is my class for that
`
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());
}
}
`
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我得到了解决方案。需要使用用户定义的类生成 jar 文件,然后需要将它们加载到 weblogic 启动类中。所以没有问题。
但仍然无法在http标头中找到用户名和密码。
I got the solution. Need to generate a jar file with the user defined classes then need to load these in the weblogic startup classes. So no issues.
But still unable to find the username and password in the http headers.
使用大写的“x”(“X-MyCustomField”而不是“x-MyCustomField”)
Use the 'x' in uppercase ('X-MyCustomField' instead of 'x-MyCustomField')