Clone MDCInsertingServletFilter and change it to use request.getRemoteAddr() which returns the IP address the caller.
Consider a pull request to fix this in logback > On 30 Mar 2017, at 13:46, Murray, Thomas - 3 <[email protected]> > wrote: > > Hi, > > I have configured my application with the MDCInsertingServletFilter and added > the %X{req.remoteHost} to my logback.xml pattern attribute. The log is > showing the fully qualified name of the client that sent the request. > However, I would like to log the IP and not the fully qualified host name. > The documentation for getRemoteHost() states "If the engine cannot or chooses > not to resolve the hostname (to improve performance), this method returns the > dotted-string form of the IP address". How do I configure the engine to not > resolve fully qualified host name? > > Thanks in advance for your assistance, > > Tom. > > ---------------------------------------------------------------------- > 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. > _______________________________________________ > logback-user mailing list > [email protected] > http://mailman.qos.ch/mailman/listinfo/logback-user _______________________________________________ logback-user mailing list [email protected] http://mailman.qos.ch/mailman/listinfo/logback-user
