<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<br>
<div class="moz-cite-prefix">On 9/22/15 3:55 PM, Khawer Masood
wrote:<br>
</div>
<blockquote cite="mid:E2025EDA-1B90-4B52-96F8-88840A04D1F4@gwu.edu"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<div class="">To capture the end user’s IP address in the audit
logs, I have tried these patterns in <font class=""
face="Courier New">conf/logback.xml</font> without success:</div>
<div class=""><br class="">
</div>
<font class="" face="Courier New">1. <Pattern>%msg|%<b
class="">X</b>{req.xForwardedFor}|%n</Pattern></font> — does
not log anything in v3, but worked in Tomcat 6/IdP v2 (in
conf/logging.xml) — see <a moz-do-not-send="true"
href="http://logback.qos.ch/manual/mdc.html#mis" class="">http://logback.qos.ch/manual/mdc.html#mis</a><br
class="">
<div class=""><font class="" face="Courier New"><br class="">
</font></div>
<div class=""><font class="" face="Courier New">2.
<Pattern>%msg|%<b class="">mdc</b>{</font><span
style="font-family: 'Courier New';" class="">req.xForwardedFor</span><font
class="" face="Courier New">}|%n</Pattern></font> — does
not log anything<br class="">
</div>
</blockquote>
<br>
<br>
I wasn't aware of that component in Logback. Looks nice. In order
for it to work, you have to add the
<meta http-equiv="content-type" content="text/html;
charset=windows-1252">
MDCInsertingServletFilter to your web.xml. Are you saying you've
done that and it's still not working? If so, I'd bet you just have
an issue with the filter mapping or something like that. Not aware
of anything IdP-specific that would prevent it from working.<br>
<br>
<br>
<blockquote cite="mid:E2025EDA-1B90-4B52-96F8-88840A04D1F4@gwu.edu"
type="cite">
<div class=""><span style="font-family: 'Courier New';" class=""><br
class="">
</span></div>
<div class=""><span style="font-family: 'Courier New';" class="">3.
<Pattern></span><span style="font-family: 'Courier
New';" class="">%msg|%<b class="">mdc</b>{idp.remote_addr}|%n</span><font
class="" face="Courier New"></Pattern></font> — logs the
IP address of the httpd server[1] </div>
<div class=""><br class="">
</div>
</blockquote>
<br>
<br>
Yeah, in a proxy environment, that's not going to work - unless the
container has support for overriding and setting the request's
remote address based on the X-Forwarded-For, or something like
that. Don't know if Jetty does.<br>
<br>
<br>
</body>
</html>