{"id":9028,"date":"2016-10-19T09:32:49","date_gmt":"2016-10-19T07:32:49","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/display-correct-client-ip-address-log-file-physical-load-balancer-client-weblogic-server\/"},"modified":"2016-10-19T09:32:49","modified_gmt":"2016-10-19T07:32:49","slug":"display-correct-client-ip-address-log-file-physical-load-balancer-client-weblogic-server","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/display-correct-client-ip-address-log-file-physical-load-balancer-client-weblogic-server\/","title":{"rendered":"Documentum story \u2013 How to display correct client IP address in the log file when a WebLogic Domain is fronted by a load Balancer"},"content":{"rendered":"<p>The Load Balancers do not provide the client IP address by default. The WebLogic HTTP log file (access_log) does not provide the client IP address but the Load Balancer one.<br \/>\nThis is sometimes a problem when diagnosing issues and the Single Sign On configuration does not provide the user name in the HTTP log either.<\/p>\n<p>In most of\u00a0 the cases, the Load Balancer can provides an additional header named &#8220;X-Forwarded-For&#8221; but it needs to be configured from the Load Balancer administration people.<br \/>\nIf the &#8220;X-Forwarded-For&#8221; Header is provided, it can be fetched using the WebLogic Server HTTP extended logging.<\/p>\n<p>To enable the WebLogic Server HTTP logging to fetch the &#8220;X-Forwarded-For&#8221; Header follow the steps below for each WebLogic Server in the WebLogic Domain:<\/p>\n<ol>\n<li>Browse to the WebLogic Domain administration console and sign in as an administrator user<\/li>\n<li>Open the servers list and select the first managed server<\/li>\n<li>Select the logging TAB and the HTTP sub-tab<\/li>\n<li>Open the advanced folder and change the format to &#8220;extended&#8221; and the Extended Logging Format Fields to:\n<pre class=\"brush: actionscript3; gutter: false; first-line: 1\">\"cs(X-Forwarded-For) date time cs-method cs-uri sc-status bytes\"<\/pre>\n<\/li>\n<li>Save<\/li>\n<li>Browse back to the servers list and repeat the steps for each WebLogic Server from the domain placed behind the load balancer.<\/li>\n<li>Activate the changes.<\/li>\n<li>Stop and restart the complete WebLogic domain.<\/li>\n<\/ol>\n<p>After this, the WebLogic Servers HTTP Logging (access_log) should display the client IP address and not the Load Balancer one.<\/p>\n<p>When using the WebLogic Server extended HTTP logging, the username field is not available any more.<br \/>\nThis feature is described in the following Oracle MOS article:<br \/>\n<a href=\"https:\/\/support.oracle.com\/rs?type=doc&amp;id=1240135.1\">Missing Username In Extended Http Logs (Doc ID 1240135.1)<\/a><\/p>\n<p>To get the authenticated usename displayed, an additional custom filed provided by a custom Java class needs to be used.<\/p>\n<p>Here is an example of such Java class:<\/p>\n<pre class=\"brush: actionscript3; gutter: true; first-line: 1\">import weblogic.servlet.logging.CustomELFLogger; \nimport weblogic.servlet.logging.FormatStringBuffer; \nimport weblogic.servlet.logging.HttpAccountingInfo;\n\n\/* This example outputs the User-Agent field into a\n custom field called MyCustomField\n*\/\n\npublic class MyCustomUserNameField implements CustomELFLogger{\n\npublic void logField(HttpAccountingInfo metrics,\n  FormatStringBuffer buff) {\n  buff.appendQuotedValueOrDash(metrics.getRemoteUser());\n  }\n}\n\n<\/pre>\n<p>The next step is to compile and create a jar library.<\/p>\n<p>Set the environment running the WebLogic setWLSEnv.sh script.<\/p>\n<pre class=\"brush: actionscript3; gutter: false; first-line: 1\">javac MyCustomUserNameField.java\n\njar cvf MyCustomUserNameField.jar MyCustomUserNameField.class<\/pre>\n<p>Once done, copy the jar library file under the WebLogic Domain lib directory. This way, it will be made available in the class path of each WebLogic Server of this WebLogic Domain.<\/p>\n<p>The WebLogic Server HTTP Extended log format can now be modified to include a custom field named &#8220;x-MyCustomUserNameField&#8221;.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Load Balancers do not provide the client IP address by default. The WebLogic HTTP log file (access_log) does not provide the client IP address but the Load Balancer one. This is sometimes a problem when diagnosing issues and the Single Sign On configuration does not provide the user name in the HTTP log either. [&hellip;]<\/p>\n","protected":false},"author":24,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[197,525],"tags":[307],"type_dbi":[],"class_list":["post-9028","post","type-post","status-publish","format-standard","hentry","category-application-integration-middleware","category-enterprise-content-management","tag-oracle-weblogic"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Documentum story \u2013 How to display correct client IP address in the log file when a WebLogic Domain is fronted by a load Balancer - dbi Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/display-correct-client-ip-address-log-file-physical-load-balancer-client-weblogic-server\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Documentum story \u2013 How to display correct client IP address in the log file when a WebLogic Domain is fronted by a load Balancer\" \/>\n<meta property=\"og:description\" content=\"The Load Balancers do not provide the client IP address by default. The WebLogic HTTP log file (access_log) does not provide the client IP address but the Load Balancer one. This is sometimes a problem when diagnosing issues and the Single Sign On configuration does not provide the user name in the HTTP log either. [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/display-correct-client-ip-address-log-file-physical-load-balancer-client-weblogic-server\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2016-10-19T07:32:49+00:00\" \/>\n<meta name=\"author\" content=\"G\u00e9rard Wisson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"G\u00e9rard Wisson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/display-correct-client-ip-address-log-file-physical-load-balancer-client-weblogic-server\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/display-correct-client-ip-address-log-file-physical-load-balancer-client-weblogic-server\/\"},\"author\":{\"name\":\"G\u00e9rard Wisson\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/ad54b5e621903122c00c6b7921c6ab85\"},\"headline\":\"Documentum story \u2013 How to display correct client IP address in the log file when a WebLogic Domain is fronted by a load Balancer\",\"datePublished\":\"2016-10-19T07:32:49+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/display-correct-client-ip-address-log-file-physical-load-balancer-client-weblogic-server\/\"},\"wordCount\":382,\"commentCount\":0,\"keywords\":[\"Oracle WebLogic\"],\"articleSection\":[\"Application integration &amp; Middleware\",\"Enterprise content management\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/display-correct-client-ip-address-log-file-physical-load-balancer-client-weblogic-server\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/display-correct-client-ip-address-log-file-physical-load-balancer-client-weblogic-server\/\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/display-correct-client-ip-address-log-file-physical-load-balancer-client-weblogic-server\/\",\"name\":\"Documentum story \u2013 How to display correct client IP address in the log file when a WebLogic Domain is fronted by a load Balancer - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\"},\"datePublished\":\"2016-10-19T07:32:49+00:00\",\"author\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/ad54b5e621903122c00c6b7921c6ab85\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/display-correct-client-ip-address-log-file-physical-load-balancer-client-weblogic-server\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/display-correct-client-ip-address-log-file-physical-load-balancer-client-weblogic-server\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/display-correct-client-ip-address-log-file-physical-load-balancer-client-weblogic-server\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/www.dbi-services.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Documentum story \u2013 How to display correct client IP address in the log file when a WebLogic Domain is fronted by a load Balancer\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/ad54b5e621903122c00c6b7921c6ab85\",\"name\":\"G\u00e9rard Wisson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/1eb607e2c436690f1f57c55db47a3fabb0d11955ea9a2510605d5e5813632408?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/1eb607e2c436690f1f57c55db47a3fabb0d11955ea9a2510605d5e5813632408?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/1eb607e2c436690f1f57c55db47a3fabb0d11955ea9a2510605d5e5813632408?s=96&d=mm&r=g\",\"caption\":\"G\u00e9rard Wisson\"},\"description\":\"G\u00e9rard Wisson has more than ten years of experience in Enterprise Content Management (ECM) with Documentum as well as in Oracle WebLogic and Java EE \/ J2EE infrastructures. He is specialized in ECM infrastructure services such as installation, upgrade, high availability, and administration as well as in Oracle WebLogic services such as installation, configuration, and management. He is very experienced in the monitoring and optimization of Java EE \/ J2EE infrastructures with Grid\/Cloud Control and JVMD. G\u00e9rard Wisson is certified Oracle Weblogic Server 11g System Administrator and Oracle Certified Associate. Prior to joining dbi services, G\u00e9rard Wisson was Senior Consultant at Solfit in Basel. He holds a diploma in Electrical Engineering from the University of Strasbourg (F). His branch-related experience covers Financial Services \/ Banking, Chemicals &amp; Pharmaceuticals, etc.\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/author\/gerard-wisson\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Documentum story \u2013 How to display correct client IP address in the log file when a WebLogic Domain is fronted by a load Balancer - dbi Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/display-correct-client-ip-address-log-file-physical-load-balancer-client-weblogic-server\/","og_locale":"en_US","og_type":"article","og_title":"Documentum story \u2013 How to display correct client IP address in the log file when a WebLogic Domain is fronted by a load Balancer","og_description":"The Load Balancers do not provide the client IP address by default. The WebLogic HTTP log file (access_log) does not provide the client IP address but the Load Balancer one. This is sometimes a problem when diagnosing issues and the Single Sign On configuration does not provide the user name in the HTTP log either. [&hellip;]","og_url":"https:\/\/www.dbi-services.com\/blog\/display-correct-client-ip-address-log-file-physical-load-balancer-client-weblogic-server\/","og_site_name":"dbi Blog","article_published_time":"2016-10-19T07:32:49+00:00","author":"G\u00e9rard Wisson","twitter_card":"summary_large_image","twitter_misc":{"Written by":"G\u00e9rard Wisson","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/display-correct-client-ip-address-log-file-physical-load-balancer-client-weblogic-server\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/display-correct-client-ip-address-log-file-physical-load-balancer-client-weblogic-server\/"},"author":{"name":"G\u00e9rard Wisson","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/ad54b5e621903122c00c6b7921c6ab85"},"headline":"Documentum story \u2013 How to display correct client IP address in the log file when a WebLogic Domain is fronted by a load Balancer","datePublished":"2016-10-19T07:32:49+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/display-correct-client-ip-address-log-file-physical-load-balancer-client-weblogic-server\/"},"wordCount":382,"commentCount":0,"keywords":["Oracle WebLogic"],"articleSection":["Application integration &amp; Middleware","Enterprise content management"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/display-correct-client-ip-address-log-file-physical-load-balancer-client-weblogic-server\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/display-correct-client-ip-address-log-file-physical-load-balancer-client-weblogic-server\/","url":"https:\/\/www.dbi-services.com\/blog\/display-correct-client-ip-address-log-file-physical-load-balancer-client-weblogic-server\/","name":"Documentum story \u2013 How to display correct client IP address in the log file when a WebLogic Domain is fronted by a load Balancer - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"datePublished":"2016-10-19T07:32:49+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/ad54b5e621903122c00c6b7921c6ab85"},"breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/display-correct-client-ip-address-log-file-physical-load-balancer-client-weblogic-server\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/display-correct-client-ip-address-log-file-physical-load-balancer-client-weblogic-server\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/display-correct-client-ip-address-log-file-physical-load-balancer-client-weblogic-server\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Documentum story \u2013 How to display correct client IP address in the log file when a WebLogic Domain is fronted by a load Balancer"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/ad54b5e621903122c00c6b7921c6ab85","name":"G\u00e9rard Wisson","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/1eb607e2c436690f1f57c55db47a3fabb0d11955ea9a2510605d5e5813632408?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/1eb607e2c436690f1f57c55db47a3fabb0d11955ea9a2510605d5e5813632408?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1eb607e2c436690f1f57c55db47a3fabb0d11955ea9a2510605d5e5813632408?s=96&d=mm&r=g","caption":"G\u00e9rard Wisson"},"description":"G\u00e9rard Wisson has more than ten years of experience in Enterprise Content Management (ECM) with Documentum as well as in Oracle WebLogic and Java EE \/ J2EE infrastructures. He is specialized in ECM infrastructure services such as installation, upgrade, high availability, and administration as well as in Oracle WebLogic services such as installation, configuration, and management. He is very experienced in the monitoring and optimization of Java EE \/ J2EE infrastructures with Grid\/Cloud Control and JVMD. G\u00e9rard Wisson is certified Oracle Weblogic Server 11g System Administrator and Oracle Certified Associate. Prior to joining dbi services, G\u00e9rard Wisson was Senior Consultant at Solfit in Basel. He holds a diploma in Electrical Engineering from the University of Strasbourg (F). His branch-related experience covers Financial Services \/ Banking, Chemicals &amp; Pharmaceuticals, etc.","url":"https:\/\/www.dbi-services.com\/blog\/author\/gerard-wisson\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/9028","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/24"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=9028"}],"version-history":[{"count":0,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/9028\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=9028"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=9028"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=9028"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=9028"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}