Diego Dias
Diego Dias

Reputation: 22616

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 configuration on JBOSS if possible.

Upvotes: 5

Views: 4824

Answers (2)

Sasi
Sasi

Reputation: 757

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())

Upvotes: 7

thelost
thelost

Reputation: 6694

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

Upvotes: 0

Related Questions