java - How to log ip address on JBoss -
I want to log the client's IP address which is calling my WS.
How can I do that?
Edit:
If possible, I would like to use log4J configuration on JBOSS.
Add your conversion pattern parameters to the log4j configuration xml.
% X {Remote adder}
and in your code you can log the IP address as follows:
MDC.put ("RemoteAddress", request.getRemoteAddr ())
Comments
Post a Comment