<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">I am using logback v1.1.3 with my deployed Weblogic application.  I am trying to log client ip address along with the xForwaredFor IP address.  I added the MDC filter to the application deployment web.xml file and modified the logback.xml
 file.  The log output correctly displays the xForwardedFor IP address.  However, I am getting a PARSER_ERROR for the client ip (IP=%h).    Any ideas on logging the request source IP?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Here is my configuration:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-size:8.0pt"><?xml version="1.0" encoding="UTF-8"?><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt"><configuration><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt">        <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt">                <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt">                        <pattern>%d %-5p [IP<span style="background:yellow;mso-highlight:yellow">=%h</span>  %X{req.remoteHost} %X{req.requestURI} External IP=%X{req.xForwardedFor}] - %msg%n</pattern><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt">                </encoder><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt">        </appender><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt">        <appender name="LOGFILE" class="ch.qos.logback.core.rolling.RollingFileAppender"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt">            <File>applogs/${weblogic.Name}.log</File><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt">                <!--<pattern>%d [%thread] %-5p - %msg%n</pattern>--><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt">                <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt">                        <pattern>%d %-5p [IP<span style="background:yellow;mso-highlight:yellow">=%h</span>  %X{req.remoteHost} %X{req.requestURI} External IP=%X{req.xForwardedFor}] - %msg%n</pattern><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt">                </encoder><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt">            <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt">                <FileNamePattern>applogs/${weblogic.Name}-%d{yyyy-MM-dd}.log.%i.gz</FileNamePattern><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt">                <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt">                    <maxFileSize>25MB</maxFileSize><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt">                </timeBasedFileNamingAndTriggeringPolicy><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt">                <!-- Keep 3 days' worth of history --><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt">                <maxHistory>3</maxHistory><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt">            </rollingPolicy><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt">        </appender><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt">        <root level="DEBUG"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt">            <appender-ref ref="CONSOLE"/><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt">            <appender-ref ref="LOGFILE"/><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt">        </root><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt"></configuration><o:p></o:p></span></p>
</div>

<HR>This message, and any attachments, is for the intended recipient(s) only, may contain information that is privileged, confidential and/or proprietary and subject to important terms and conditions available at http://www.bankofamerica.com/emaildisclaimer.   If you are not the intended recipient, please delete this message.<BR>
</body>
</html>