My Oracle Support Banner

How to Configure WebLogic Server to Capture Client IP Addresses Behind a Load Balancer Using Extended Log Format (Doc ID 1602379.1)

Last updated on DECEMBER 16, 2023

Applies to:

Oracle WebLogic Server - Version 10.3.3 and later
Information in this document applies to any platform.

Purpose

The purpose of this document is to outline steps to capture the original client IP in a WebLogic Managed Server’s access log without the use of a web server with mod_wls plugin. It is specifically meant for a configuration like this:

        Client -> Hardware Load Balancer -> Managed Server

where there are no web servers but more than one Managed Server.

Scope

WLS managed servers have access logs, similar to other http server's access logs. A managed server's access log is configured to use the common log format which is used, for example, by the Oracle HTTP Server (OHS).

However, the common log format cannot capture the client's IP address if there is a load balancer between the client at the managed servers; the log format will always log the IP address for the load balancer.

In many instances it is desirable to capture the IP address of the actual client making the request.

The solution described in this document is to configure Extended Log Format with some custom jars for the WLS managed servers.

This requires some coding, configuration changes for the managed server and a managed server restart.

This procedure was developed with the following environment

Oracle Weblogic Server: 12.1.1, 64-bit
JVM: JRockit 1.6.0_45b06, 64-bit
Compiler: javac, 1.6.0_45, 64-bit
RedHat Enterprise Linux/Oracle Enterprise Linux 6, 64-bit
(2.6.32358.2.1.el6.x86_64)

Details

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Purpose
Scope
Details
 Configure the Load Balancer
 Create Custom jar
 Add the Custom jar File to the CLASSPATH
 Configuring Extended Log Format
 Testing the Extended Log Format
References

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.