如何在 JBoss 上记录 IP 地址
我想记录呼叫我的 WS 的客户端的 IP 地址。
我怎样才能在 JBoss 上做到这一点?
编辑:
如果可能的话,我想在 JBOSS 上使用 log4J 配置。
I want to log the IP address of the client who is calling my WS.
How can I do that on JBoss?
EDIT:
I would like to use log4J configuration on JBOSS if possible.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将以下内容附加到 log4j 配置 xml 中的转换模式参数。
在您的代码中,您可以按如下方式记录 IP 地址:
Append the following to your conversion pattern parameter in log4j configuration xml.
And in your code you can log the ip address as follows:
如果您通过 EJB3 提供功能,请阅读本文。
Read this, in case you are provind functionality via EJB3.