Use NDC to log IP addresses

Shawn Wilson <[email protected]>
Newsgroups gmane.comp.java.enhydra.barracuda.general
Message-ID <[email protected]>
I was thinking about using Log4j's NDC (Nested Diagnostic Context) 
mechanism to allow output of the remote IP address in the logs. Attached 
to this email is a modified ApplicationGateway that seems to do the 
trick. As long as you have the %x pattern defined in your appender(s) 
you should be able to see the remote IP address on the logging 
statements in your code.

Jake/Christian: what do you think of this implementation? Is this the 
right spot for it? Search for saw_061203_1 to see what I added.

Any comments would be appreciated.

Thanks,
-shawn
ApplicationGateway.zip (application/x-zip, 9.8 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.