0 Replies Latest reply: Mar 18, 2012 1:39 PM by 696996 RSS

    log4j not logging messages out to weblogic console for custom automatplugin

    696996
      Hi,

      We have a custom automation plugin for the OSM application build 381 in our environment(HP-UX Itanium platform). The plugins are bundled in a single ear application "A.ear" which is a mixed bag of pre-defined automation plugins of type XsltSender, XsltAutomator(both InternalReciever as well ExternalReceiver) as well other custom automators(java). For logging of messages in order to aid debugging of custom automators, we are using a logger "com.xyz.osm.plugin" which is also declared in log4j.xml file that is within omslogging.jar. You must already be aware that the build scripts of assembling, deploying ansd registering plugins also includes omslogging.jar are part of the application ear.

      <category name="com.mtsa.osm.plugin">
      <priority value="debug"/>
      </category>

      Below java code snippet is taken from our custom automation plugin classes indicating how the above logger is being used for printing messages.
      //Declaration
      private static Log log = LogFactory.getLog("com.mtsa.osm.plugin");

      mthod1(){
      log.info("xyz");
      }

      In addition to the above logger, the pre-defined automators XsltSender, XsltReceiver also enable logging from xsl files by making the "log" parameter available. Thus we have lines such as the one below in our xsl files that should print messages to the weblogic console.

      <xsl:variable name="addLog1" select="java:info($log, 'transformSiebelActivationRequest: ***** Starting *****')"/>

      The logger that allows printing of these lines is "com.mslv.oms.automation".

      <category name="com.mslv.oms.automation">
      <priority value="info"/>
      </category>

      These configurations should have ideally allowed one to see messages such as one below getting printed out to weblogic console:

      <16-Mar-2012 8:59:36,931 CDT PM> <INFO> <plugin.XSLTReceiver> <ExecuteThread: '19' for queue: 'oms.automation'> <transformSiebelActivationRequest: ***** Starting *****>

      Unfotunately after having done all the above configuration, we are still unable to see any such log messages in the console apart from those emitting from SOP and from <xsl:message> inserted in java & xsl files respectively.

      I also checked if the log4j sub-system is able to correctly initialize after parsing the log4j.xml. It does and one can confirm it by setting system property log4j.debug=true in setDomainEnv.sh file.

      $$$$$$$$ log4j initialization by application classloader for oms.ear application $$$$$$$$$$$$$$$$$$

      log4j: Trying to find [log4j.xml] using context classloader weblogic.utils.classloaders.GenericClassLoader@1592141 finder: weblogic.utils.classloaders.CodeGenClassFinder@1112e85 annotation: oms@.
      log4j: Using URL [zip:/home/osmwl/bea/user_projects/domains/dev04/servers/osmdev04/tmp/_WL_user/oms/amuube/omslogging.jar!/log4j.xml] for automatic log4j configuration.
      log4j: Preferred configurator class: org.apache.log4j.xml.DOMConfigurator
      log4j: System property is :null
      log4j: Standard DocumentBuilderFactory search succeded.
      log4j: DocumentBuilderFactory is: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl

      $$$$$$$$ log4j initialization by application classloader for custom automation plugin xyz.ear application $$$$$$$$$$$$$$$$$$

      log4j: Trying to find [log4j.xml] using context classloader weblogic.utils.classloaders.GenericClassLoader@1b7a8c5 finder: weblogic.utils.classloaders.CodeGenClassFinder@10bc849 annotation: xyz.ear@.
      log4j: Using URL [zip:/home/osmwl/bea/user_projects/domains/dev04/servers/osmdev04/tmp/_WL_user/xyz.ear/ah0eeq/omslogging.jar!/log4j.xml] for automatic log4j configuration.
      log4j: Preferred configurator class: org.apache.log4j.xml.DOMConfigurator
      log4j: System property is :null
      log4j: Standard DocumentBuilderFactory search succeded.
      log4j: DocumentBuilderFactory is: weblogic.xml.jaxp.RegistryDocumentBuilderFactory
      log4j: debug attribute= "false".

      Ironically, logging levels for loggers defined in log4j.xml of oms.ear could be dynamically changed from log4jAdmin.jsp page and the results are immediately visible. However for some reason, loggers defined in log4j.xml of custom plugin application were completely getting ignored. I don't see any warnings or erro messages in the logs indicating that log4j configuration failed for custom application failed. We want to refrain using SOP and <xsl:message> but I am afraid we have no option other than filling up our sources files with them.

      Bottomline, how do we get application B(which in our case is the custom plugin) to log messaged the console just like that done by application A(oms.ear).

      I am sure OSM developers would like to leverage log4j bundled with OSM SDK to log messages that would aid in trouble-shooting during development cycles. Both application ear files have commons-logging-1.1.jar,log4j-1.2.13.jar, omslogging.jar available in their classpaths. In other words, META-INF/MANIFEST.MF file of oms.war(web module within oms.ear) and xyz.jar(ejb module within xyz.ear) has references to these jars.


      Appreciate if one can reply and let me know if they could get log messages to print from custom plugin.

      Thanks

      Edited by: user3693508 on Mar 18, 2012 11:38 AM