public class

AccessLogIPAddressUtil

extends Object
java.lang.Object
   ↳ com.atlassian.jira.web.filters.accesslog.AccessLogIPAddressUtil

Class Overview

This can give back a IP address String that take into account proxies and X-Forwarded-For etc...

Summary

Public Constructors
AccessLogIPAddressUtil()
Public Methods
static String getRemoteAddr(HttpServletRequest httpServletRequest)
This will return a set of IP addresses that MAY include PROXY forwarded addresses
static String getShortenedRequestUrl(HttpServletRequest httpServletRequest)
This will shorten the Request URL into something that is more acceptable from a logging point of view
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public AccessLogIPAddressUtil ()

Public Methods

public static String getRemoteAddr (HttpServletRequest httpServletRequest)

This will return a set of IP addresses that MAY include PROXY forwarded addresses

Parameters
httpServletRequest the request in play
Returns
  • an address in the format nnn.nnn.nnn.nnn [, nnn.nnn.nnn.nnn ...]

public static String getShortenedRequestUrl (HttpServletRequest httpServletRequest)

This will shorten the Request URL into something that is more acceptable from a logging point of view

Parameters
httpServletRequest the request in play
Returns
  • the request URL shortened down to remove hostname and context