02 May 2016

WebLogic access log files

Many times in development side, we want to access log files for a remote weblogic.
One easy way (to avoid several constraints) is to have like-a webpage to see these files.

This can be achieved easily with weblogic.xml parameters:

Different WebLogic Server Tools
Bunch of tools to help WLS admin, debugging, etc.
  1. This first version is a war file to access log files from remote client through an HTML file generated by WLS.
  2. the core idea is to show the directories/files of a particular server, this way we can debug easily. 
https://github.com/devwebcl/wls_contraption

The weblogic.xml is:

 <?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-web-app xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-web-app" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.3/weblogic-web-app.xsd">
    <wls:weblogic-version>10.3.6</wls:weblogic-version>
    <wls:context-root>logs_retrieval</wls:context-root>
   
<!--

/u01/domains1036/MYDOMAIN/logs
/u01/domains1036/MYDOMAIN/servers/SERVER1/logs


/ u01/ domains1036/ MYDOMAIN/ apps/ app1-wl/ dist/ app1. ear
/ u01/ domains1036/ MYDOMAIN/ apps/ app2-auth/ dist/ app2. war

error_web.log :
/tmp

----

 index-directory-enabled

The <index-directory-enabled> element controls whether or not to automatically generate an HTML directory listing if no suitable index file is found.
The default value is false (does not generate a directory). Values are true or false.
https://docs.oracle.com/cd/E28280_01/web.1111/e13712/weblogic_xml.htm#WBAPP596

  -->
    <wls:container-descriptor>
        <wls:index-directory-enabled>true</wls:index-directory-enabled>
    </wls:container-descriptor>

    <wls:virtual-directory-mapping>
        <wls:local-path>/u01/domains1036/MYDOMAIN</wls:local-path>
        <wls:url-pattern>/servers/logs/*</wls:url-pattern>
    </wls:virtual-directory-mapping>

    <wls:virtual-directory-mapping>
        <wls:local-path>/u01/domains1036/MYDOMAIN/</wls:local-path>
        <wls:url-pattern>/logs/*</wls:url-pattern>
    </wls:virtual-directory-mapping>

    <!-- depending on OS we must use : "/" or "c:" -->
    <wls:virtual-directory-mapping>
        <!-- wls:local-path>c:/</wls:local-path -->
        <wls:local-path>/</wls:local-path>
        <wls:url-pattern>/tmp/*</wls:url-pattern>
    </wls:virtual-directory-mapping>
   
   
    <wls:jsp-descriptor>
      <wls:page-check-seconds>0</wls:page-check-seconds>
    </wls:jsp-descriptor>
    <wls:container-descriptor>
      <wls:servlet-reload-check-secs>0</wls:servlet-reload-check-secs>
      <wls:resource-reload-check-secs>0</wls:resource-reload-check-secs>
    </wls:container-descriptor>

</wls:weblogic-web-app>


No comments :

My Blog List

Blog Archive

Disclaimer

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.