开发者

How to log ip address on JBoss

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 conf开发者_如何学JAVAiguration on JBOSS if possible.


Append the following to your conversion pattern parameter in log4j configuration xml.

%X{RemoteAddress}

And in your code you can log the ip address as follows:

MDC.put("RemoteAddress", request.getRemoteAddr())


Read this, in case you are provind functionality via EJB3.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜