[prev in list] [next in list] [prev in thread] [next in thread] 

List:       log4j-user
Subject:    MDC and Client IP Addresses
From:       Tim Sawyer <tsawyer () nildram ! co ! uk>
Date:       2002-06-27 10:31:51
[Download RAW message or body]

Hello All,

I'm looking for a way of logging client IP address in each log entry.  I have a \
struts based application, with lots of log4j statements sprinkled throughout the \
code.

I thought that MDC was what I wanted, but I've just tried it and it didn't work.  I \
put the IP address at the start of the site, and removed it at the end, but I found \
that the IP address became web server global - last person to set it was the value \
that printed out, regardless of where the call came from.  From reading the \
documentation it appears that MDC works on a per thread basis.  As far as I can tell, \
the Orion web app server we are using runs every client in the same thread, so this \
would make sense. 

What options do I have for getting this to work?  All I want is to output the client \
IP address on each line of trace.

ta,

Tim.





--
To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic